我是python的新手。试着自学。下面是我的python程序。当我试图在Powershell中运行它的时候。它就这么卡住了。它永远不会显示任何输出。我在屏幕上看不到任何错误。
from sys import argv
script, name = argv
print "this is: ", script
print "my name is: ", name
age = raw_input("what is your age: ")
height = raw_input("what is your height")
print "so your name is %s, your age is %s and height is %r" %(name, age, height)
谢谢
发布于 2018-06-17 03:35:54
这段代码将会工作:
from sys import argv
script, name = argv
print ("this is: ", script)
print ("my name is: ", name)
age = input("what is your age: ")
height = input("what is your height")
print ("so your name is {}, your age is {} and height is {}" .format(name, age, height))
Python3中有一些更新,所以我猜这就是为什么一定有一些语法错误的原因。
我也是一个初学者(这是我在stackoverflow上的第一个答案),我一直在阅读“艰难地学习Python”这本书。我遇到了和你一样的问题:
https://stackoverflow.com/questions/26706395
复制相似问题