1,105,423 Community Members

help in question

Member Avatar
Newbie Poster
1 post since Jan 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]

Write a Python program to apply the given formulae above to complete the
missing information in Table 2.2. As vMax (his speed at 30,000m) is an unknown,
allow the user to input a value of between 500m/s and 600m/s, each time
displaying a new completed table. For an extra 3 marks, force the user to enter a
value between 500 and 600 m/s.
Output the table in columns with all numbers aligned right and all decimal points
lined up. Because of the importance of accuracy, calculate all results to 3
decimal places

hi can anyone help me in putting the results i get out of the loop into a table and also
i want to know how to limit the value of Vmax of the first input to values 500-600 but when asked to enter Vmax the second time i want no restrictions. any ideas on how to do so. fyi this is python.

while True: 
    Vmax= float(input("enter Value for max speed: ",))# this will ask user to enter any value for Vmax
    if Vmax >= 500 and Vmax <=600:
    Vmax= float(input("enter Value for max speed: ",))
    Vmin= float(input("enter Value for min speed: ",))#this will ask user to enter any value for Vmin
    dt= float(input("enter the distance travelled: ",))#this will ask user to enter any value for distance travelled
    Va=((Vmax + Vmin)/2) # this is the equation which is used to find average speed
    t=dt/Va #this equation determines time taken
    print("t     |  Va")
    print ("%4.3f | %6.3f"%(t, Va))
    if c==3:
Member Avatar
6,104 posts since Apr 2010
Reputation Points: 818 [?]
Q&As Helped to Solve: 1,056 [?]
Skill Endorsements: 42 [?]
if c==3:

if can not exist without statements, if you want to use place holder use pass

if c==3:
This article has been dead for over three months: Start a new discussion instead
Start New Discussion
Tags Related to this Article