print ("Enter the object you are tyring to find.")
print ("1 = Radius")
print ("2 = Arch Length")
print ("3 = Degree")
print ("4 = Area")
x = int(input("(1,2,3,4):"))
if x == 1:
print ("You are finding the Radius.")
ra = int(input("Enter the arch length: "))
rd = int(input("Enter the degree: "))
rr = ra/math.radians(rd)
print ("The Radius is:",rr)
if x == 2:
print ("You are finding the Arch Length.")
sr = int(input("Enter the radius: "))
sd = int(input("Enter the degree: "))
ss = math.radians(sd)*sr
print ("The Arch Length is:",ss)
我正在做一個基本的數學程序,但我希望它可以無限重複。這不是完整的代碼,但我想爲其餘的「if」語句做同樣的事情。我希望它在每個功能完成後結束並重復回到第一行。謝謝!我如何讓我的python程序重新啓動到某一行?
似乎工作爲一個循環 – aberna 2015-01-26 21:20:40