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