这是我的代码:
# Get the user's starting weight.
weight = input('What is your starting weight? ')
# Display the weight loss table.
for month in range(1, 7):
weight = -4
print('At the end of month', month,
'your weight will be', weight, 'lbs.')
我想尝试改变:
weight = -4
到:
weight -= 4
还要使输入成为一个字符串,如下所示:
# Get the user's starting weight.
weight = int(input('What is your starting weight? '))
# Display the weight loss table.
for month in range(1, 7):
weight -= 4
print('At the end of month', month,
'your weight will be', weight, 'lbs.')
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句