试图使这项工作不知道为什么会这样

基恩

这是我的代码:

# 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.')
U12-转发

我想尝试改变:

    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] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

不知道为什么会这样

存在的操作员如何工作?我不知道为什么会这样

我不知道为什么会这样。jedis 创建名为“jedisConnectionFactory”的 bean 时出错

TypeError: 'int' 对象不可迭代,不知道为什么会这样

Action Mailer 不工作,不知道为什么

imagecopyresampled无法正常工作不知道为什么

工作簿保存失败,不知道为什么

"bios.lua:26: [string "turbinecontrol"]:15: 'then' expected" 我不知道为什么会这样

我超过了 *image 数组 2 个字节,但不知道为什么会这样

4行python代码。不知道为什么打印出这样的输出

不知道为什么Java mergesort算法偶尔会失败

不知道为什么我的程序默认会输出最后一个if语句

在执行这个程序时,char 函数会返回变量。我不知道为什么?

我的Paint方法运行两次,我不知道为什么。我该如何解决这个问题,有人知道为什么会这样吗?

不知道为什么这个 stream() 不能在这个嵌套列表上工作?

我不知道为什么我的clearfix无法正常工作

最长的递增子序列,算法工作不正确,不知道为什么

EventListener 不工作 JavaScript,我不知道为什么

网络停止工作,我不知道为什么

jQuery AJAX调用无法正常工作,不知道为什么

SourceTree Push计数工作方式不同,我不知道为什么

Justify-content 在我的 flexbox 中停止工作,我不知道为什么

编码新手,我不知道为什么我的javascript按钮无法正常工作?

我无法使这几行简单的代码正常工作,也不知道为什么

我的春季验证停止工作,我不知道为什么

我的JavaScript验证刚刚停止工作,我不知道为什么

Unity:GameObject.FindGameObjectWithTag无法正常工作,我也不知道为什么

Android onItemClickListener 只工作一次,不知道为什么

Python if 语句无法正常工作,不知道为什么