找回密码
 中文实名注册
楼主: admin

【Python作业】第三单元 第7课 小熊摘桃 综合项目

[复制链接]

3

主题

45

帖子

1215

积分

金牌会员

Rank: 6Rank: 6

积分
1215
发表于 2021-12-11 15:06:44 | 显示全部楼层
tree = 0
total = 0
while True:
    tree = tree+1
    total = total+tree
    print(tree)
    print(total)
    if total >= 120:
        break
回复

使用道具 举报

17

主题

82

帖子

4444

积分

版主

你爸爸

Rank: 7Rank: 7Rank: 7

积分
4444
发表于 2021-12-11 15:06:28 | 显示全部楼层

回帖奖励 +40 金钱

本帖最后由 曹帅 于 2021-12-11 15:17 编辑

tree=0
total=0
while True:
    tree=tree + 1
    if tree  % 3!=0
        total = total + tree
    print(tree)
    print(total)
    if total >=120:
        print("第 {tree} 棵数的时候")
            break



tree = 0
total = 0
while True:
    tree = tree + 1
    total = total + tree
    print(tree)
    print(total)
    if total >=120:
        break


回复

使用道具 举报

9

主题

59

帖子

1585

积分

金牌会员

Rank: 6Rank: 6

积分
1585
发表于 2021-12-11 15:05:54 | 显示全部楼层

回帖奖励 +40 金钱

tree = 0
total = 0
while True:
    tree = tree + 1
    if tree % 3 != 0:
    total = total + tree
print(tree)
print(total)
if total >= 120:
    print('第'  + str(tree)+'棵的时候摘够了')
    break

    tree = 0
total = 0
while True:
    tree = tree + 1
    total = total + tree
    print(tree)
    print(total)
    if total >= 120:
        break
回复

使用道具 举报

3

主题

45

帖子

1215

积分

金牌会员

Rank: 6Rank: 6

积分
1215
发表于 2021-12-11 15:05:53 | 显示全部楼层

回帖奖励 +40 金钱

tree = 0
total = 0
while True:
    tree = tree+1
    if tree % 3 != 0:
    total = total+tree
    print(tree)
    print(total)
    if total >= 120:
        print('第'+ str(tree)+'颗的时候摘够啦!')
        break
回复

使用道具 举报

5

主题

67

帖子

1103

积分

金牌会员

Rank: 6Rank: 6

积分
1103
发表于 2021-12-11 15:02:54 | 显示全部楼层

回帖奖励 +40 金钱

tree=0
total=0

While True
    total=total+tree
    print(tree)
    print(total)
    if total>=120
        print(i)
回复

使用道具 举报

2

主题

46

帖子

1437

积分

金牌会员

Rank: 6Rank: 6

积分
1437
发表于 2021-12-11 15:01:12 | 显示全部楼层

回帖奖励 +40 金钱

tree = 0
total = 0
while True:
    tree = tree + 1
    total = total + tree
    print(tree)
    print(total)
    if total >= 120:
        break

tree = 0
total = 0
while True:
    tree = tree + 1
    if tree % 3 != 0:
        total = total + tree
    print(tree)
    print(total)
    if total >= 120:
        print('第' + str(tree) + '棵的时候摘够了')
        break
回复

使用道具 举报

4

主题

83

帖子

3868

积分

论坛元老

Rank: 8Rank: 8

积分
3868
发表于 2021-12-11 15:00:23 | 显示全部楼层
  1. tree = 0
  2. total = 0
  3. while True:
  4.     tree = tree + 1
  5.     total = total + tree
  6.     print(tree)
  7.     print(total)
  8.     if total >= 120:
  9.         break
复制代码


回复

使用道具 举报

15

主题

96

帖子

2131

积分

金牌会员

Rank: 6Rank: 6

积分
2131
发表于 2021-12-11 14:59:33 | 显示全部楼层

回帖奖励 +40 金钱

tree=0
total=0
while True:
    tree=tree+1
    total = total +tree
    print(tree)
    print(total)
    if total>=120:
        break
tree=0
total=0
while True:
    tree=tree+1
    if tree%3!=0
        total = total +tree
    print(tree)
    print(total)
    if total>=120:
        print("第"+{tree}+"棵的时候够了")
        break
回复

使用道具 举报

4

主题

83

帖子

3868

积分

论坛元老

Rank: 8Rank: 8

积分
3868
发表于 2021-12-11 14:57:24 | 显示全部楼层

回帖奖励 +40 金钱

  1. tree = 0
  2. total = 0
  3. while True:
  4.     tree = tree + 1
  5.     if tree % 3 != 0:
  6.         total = total + tree
  7.     print(tree)
  8.     print(total)
  9.     if total >= 120:
  10.         print('第' + str(tree) + '棵的时候摘够了')
  11.         break
复制代码


回复

使用道具 举报

0

主题

16

帖子

1203

积分

金牌会员

Rank: 6Rank: 6

积分
1203
发表于 2021-12-11 11:51:29 | 显示全部楼层

回帖奖励 +40 金钱

tree = 0
total = 0
while True
    tree = tree +1
    if tree % 3 != 0
        total = total+tree
    print(tree)
    print(total)
    if total >= 120
        print('第'+str(tree)+'棵的时候摘够啦')
        break


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 中文实名注册

本版积分规则

小黑屋|东台市机器人学会 ( 苏ICP备2021035350号-1;苏ICP备2021035350号-2;苏ICP备2021035350号-3 )

GMT+8, 2024-5-2 14:11 , Processed in 0.044137 second(s), 24 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表