2024-04-20 13:31:49 发布
网友
如何将用户输入的数字与我输入的数字相乘?你知道吗
我有
weight = input ('What is your weight') print ('this is your weight on the moon') print weight*.165
这不管用为什么?你知道吗
有几个问题。正如不法分子Lemur所指出的,print是python3中的一个函数。此外,您还需要将权重设置为float或int(不管是哪个值),否则会出现TypeError。你知道吗
weight = float(input ('What is your weight'))
在python3中,^{} statement has been replaced by the ^{} function。您需要:
weight = input ('What is your weight') print ('this is your weight on the moon') print (weight*.165)
有几个问题。正如不法分子Lemur所指出的,print是python3中的一个函数。此外,您还需要将权重设置为float或int(不管是哪个值),否则会出现TypeError。你知道吗
在python3中,^{} statement has been replaced by the ^{} function 。您需要:
相关问题 更多 >
编程相关推荐