【发布时间】:2018-02-22 02:05:19
【问题描述】:
def main():
get_variables()
def get_variables():
initial_position = float(input("Enter the object's initial position: "))
initial_velocity = float(input("Enter the object's initial velocity: "))
acceleration = float(input("Enter the object's acceleration: "))
time = float(input("Enter the time that has passed: "))
if time < 0
print('The time cannot be negative')
time = float(input('Enter a valid time: ')
#formula
position_of_object = initial_position + initial_velocity * time + 0.5 * acceleration * time ** 2
#Display Position of object
print("The position of the object is: ", position_of_object)
while keep_going == 'y'
keep_going = input("Do you want to calculate another Object's poistion?" + \
'position_of_object (Enter y for yes): ')
main()
这是我的作业,上面写着
"如果时间
我对编程几乎一无所知,并且正在参加有关它的在线课程。请告诉我哪里错了
【问题讨论】: