我如何用“你想再次运行这个”的问题来循环这个代码?你知道吗
count = 1
total = 0
markslist = list()
while count <= 10:
newmark = input("Input Mark Out Of 100 (" + str(count) + ") ")
markslist.append(newmark)
if newmark > 100:
import sys
sys.exit("Error Mark is greater than 100 re-run program")
total = total + newmark
count = count + 1
average = (total / 10)
print "Average Mark = " + str(average)
只需将整个代码包装在一个类似于以下内容的循环中:
相关问题 更多 >
编程相关推荐