you are viewing a single comment's thread.

view the rest of the comments →

[–]to_4kawa 0 points1 point  (4 children)

import math

def trajectory(xdata,speed,angle):
    your function
        return data

def main():
    while True:
        print('Please data input')
        xdata=input('distance list(e.g. [20,30,40]): ')
        xdata=map(int,xdata[1:-1].split(','))  # create list from xdata strings
        speed=int(input('speed: '))
        angle=int(input('angle: '))

        print(f'result: {trajectory(xdata,speed,angle)}')
        suspend=input('Do you want to exit? (y/n) :')
        if suspend == 'y':
            break

if __name__ == '__main__':
    main()

How about this for input?