我是python的新手,我正在尝试使用raw_input和函数为程序创建一个命令.由于某种原因,它一直没有奏效.这是我一直在测试的代码:
raw_input()
def test():
print "hi, this will be amazing if it works"
Run Code Online (Sandbox Code Playgroud) 嗨,我是一个11岁的孩子,已经把python作为一种业余爱好.我正在尝试将质量转换器作为第一个项目.但由于某种原因我得到了这个错误:TypeError:不能将序列乘以'float'类型的非int
这是我的代码:
print "please enter the amount of kilograms you want to convert",
kilo = raw_input()
pounds = 2.20462
print kilo * pounds
Run Code Online (Sandbox Code Playgroud)