First, click "Solve the Problem:" to see detailed instructions and useful information.
Second, try to code a solution to the problem using the embedded Python coding environment.
Third, if you are finding it difficult, you can click "Get Some Hints:" to see some tips to help you solve the problem. There is also music to help you focus midway down the page.
Finally, at the bottom of the page, there is an embedded Form where you can paste and upload your completed solution.
Once you have uploaded your code there will be a link to the solution at the end of the Form, so just like in the exam even if you can't entirely finish the solution, upload as much as you have been able to and you can then see the correct answer afterwards to see where (if anywhere) you went wrong.
Your first line needs to be an input line that saves an input from the user as an int to a sensibly named variable.
distance = int(input("How far has been travelled in metres? "))
Integers, int, in Python only deal with whole numbers. You might want to take a decimal value for distance, in which case you can cast the input as a float (floating point/decimal number) instead.
distance = float(input("How far has been travelled in metres? "))
Your next line needs to be an input line that saves an input from the user as an int(or float if you want a precise answer) to a sensibly named variable.
time = float(input("How many seconds did the journey over the distance take? "))
Next line is saving the result of our calculation to a new variable, ready to print it out. The equation is Average Speed = Distance/Time, and the code will look *very* similar:
average_speed = distance/time (remember that in Python variables can only be one word, so we can use an underscore to link them, or just make it one word e.g. avgspeed.)
Finally, print out the result - you may want to concatenate it along with a relevant message.
print("The average speed of this journey was",average_speed,"metres per second.")
Note: If you try to concatenate your answer using + operators (print("The average speed of this journey was "+average_speed+" metres per second.")) you are going to run into an error - the value stored in average_speed is a number (either an integer or a float) so asking Python to add it to a string/sentence will confuse it.... It cannot add numbers to words, it doesn't make sense!
So if we want to use this kind of concatenation we would need to cast the variable average_speed as a string like so: print("The average speed of this journey was "+str(average_speed)+" metres per second.")