这是我必须为我的编程类(class)完成的一些非常基本的代码,我被困在这里,我收到打印语法错误,尽管我大约 99% 确定在 python 2.7.9 中打印某些内容的格式是 print “在这打字”。请帮助谷歌搜索目前对我无济于事,我相信这可能是一个快速解决方案。
minTot = 0
stepTot = 0
min = int(raw_input("Input the number of minutes (0 to exit): "))
if min == 0:
print "No minutes input."
else:
while min != 0:
minTot = minTot + min
stepRate = int(raw_input("Input the step rate: "))
stepTot = stepTot + stepRate * min
min = int(raw_input("Input the next number of minutes (0 to exit): ")
print "\nTotal number of minutes:", min
print "Total number of steps:", stepTot
# Average is rounded down.
print "Average step rate per minute: ", minTot/stepTot
最佳答案
上一行的括号不平衡:
min = int(raw_input("Input the next number of minutes (0 to exit): ")
关于python - 试图找出为什么我在第 12 行收到打印语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30068578/