Right, so this might be a rather confusing question. But in my Computer science class, we were given this optional challenge to calculate the distances a catapult has achieved after a user inputs a set of angles and speeds. But the challenge is that we have to split the problem into multiple smaller functions but each function is only allowed to have one statement per function.
I think I have a way to do it but I'm having trouble with one part.
[x = get_angles(), y = get_speeds(): 2*x[i]*y[i]/GRAVITY for i in range(len(x))]
This is part of my code for creating a list of the distances travelled. Now, this is effectively pseudo-code cause I have no clue how to make it work. Does python have anything that allows something like this to happen?
Any help would be great. Sorry for being so long-winded but thanks anyway :)