2021年1月1日星期五

Balancing an mathematical or Scientific equation using python3 as an newbie

Guys I am a newbie to programming and I am programming in Pydroid 3 ide (Android). I've tried to solve or balance the equation speed = (Distance /Time)

'''s = d ÷ t  d = s * t   t = d ÷ s'''    while True :      s = float(input('Enter value of speed'))      d = float(input('Enter value of distance'))      t =  float(input('Enter value of time'))      if '' or 'nil' or ' ' in t:          t = d / s          print("Since you didn't enter the value of time , TIME = ",t)      if '' or 'nil' or ' ' in d:          d = s * t          print("Since you didn't enter the value of distance, DISTANCE = ",d)      if '' or 'nil' or ' ' in s:          s = d / t          print("Since you didn't enter the value of speed, SPEED = ",s)  

I can't get around this problem if anyone has any suggestions it's always welcomed!

Note: To experienced this is nothing but a piece of cake.

Update : Thank you guys after an night I've got it corrected . Thank you for your suggestions friends

Here is updated code

'''speed = distance ÷ time  d = s * t   t = d ÷ s'''    #while True :  print("Well you can find the value of Speed(s)if you have the value of distance and time \n,value of distance(d)if you have the value of speed and time\n,value of Time(t) if you have the value of distance and speed")  tofind = input("s/d/t   :  ")  #   s = float(input('Enter value of speed'))  #   d = float(input('Enter value of distance'))  #   t =  float(input('Enter value of time'))  if tofind == "t":      s = float(input('Enter value of speed'))      d = float(input('Enter value of distance'))      t = d / s      print("TIME = ",t)                              if tofind == "d" :      s = float(input('Enter value of speed'))      t =  float(input('Enter value of time'))      d = s * t      print(" DISTANCE = ",d)                      if tofind == "s":      d = float(input('Enter value of distance'))      t =  float(input('Enter value of time'))      s = d / t      print(" SPEED = ",s)  
https://stackoverflow.com/questions/65532115/balancing-an-mathematical-or-scientific-equation-using-python3-as-an-newbie January 02, 2021 at 01:43AM

没有评论:

发表评论