0
「類型錯誤:需要浮點數」 我正在爲Python 2.7中的切線,正弦和餘弦計算器。我在第10行得到了錯誤TypeError: a float is required
。有人可以向我解釋這個或給我一個如何解決它的例子嗎?Python輻射計算器類型錯誤:需要浮點數
import math
tan = math.tan
cos = math.cos
sin = math.sin
while True:
selection=raw_input("Please Select:")
if selection =='1':
Tanswer=raw_input("Enter The Tangent:")
print tan(Tanswer)
elif selection == '2':
print "Work In Progress"
elif selection == '3':
print "Work In Progress"
elif selection == '4':
break
else:
print "Unknown Option Selected!"
非常感謝你:) – AdamG