【发布时间】:2015-01-21 15:53:29
【问题描述】:
1) 到目前为止,我有这段代码用于 while 循环,但我只想循环 12 次:
print ("Please enter the 12 monthly figures")
input ("Enter a value in the range 0 to 300:")
我尝试了一个 for 循环,但它没有运行
2) 我想为我的代码创建一个菜单,到目前为止我有这个:
print ("Please choose one of the following options:")
ans=True
while ans:
print ("""
0. Quit
1. Work out and display the total
3. Work out and display the mean
4. Work out and display the standard deviation
5. Work out and display the median
6. Work out and display the lowest and second lowest
7. Work out and display the 3 month
8. Work out and display the months
9. Work out display level
""")
但我想让用户选择一个
【问题讨论】:
-
你当前的密码是多少?
标签: python shell python-2.7 python-3.x while-loop