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

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

[复制链接]

2

主题

32

帖子

278

积分

中级会员

Rank: 3Rank: 3

积分
278
发表于 2021-12-12 15:03:19 | 显示全部楼层

回帖奖励 +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


回复

使用道具 举报

4

主题

35

帖子

791

积分

高级会员

Rank: 4

积分
791
发表于 2021-12-12 11:56:38 | 显示全部楼层

回帖奖励 +40 金钱

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

使用道具 举报

3

主题

32

帖子

891

积分

高级会员

Rank: 4

积分
891
发表于 2021-12-12 11:48:59 | 显示全部楼层

回帖奖励 +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
回复

使用道具 举报

4

主题

44

帖子

1536

积分

金牌会员

Rank: 6Rank: 6

积分
1536
QQ
发表于 2021-12-12 11:47:59 | 显示全部楼层

回帖奖励 +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
复制代码
回复

使用道具 举报

23

主题

188

帖子

3518

积分

版主

Rank: 7Rank: 7Rank: 7

积分
3518
发表于 2021-12-12 11:42:28 | 显示全部楼层

回帖奖励 +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

主题

41

帖子

846

积分

高级会员

Rank: 4

积分
846
发表于 2021-12-12 11:41:30 | 显示全部楼层

回帖奖励 +40 金钱

  1. tree = 0
  2. total = 0
  3. whlie 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) + '颗的时候ok')
  11.     break
复制代码


回复

使用道具 举报

15

主题

57

帖子

3170

积分

论坛元老

Rank: 8Rank: 8

积分
3170
发表于 2021-12-12 11:40:08 | 显示全部楼层

回帖奖励 +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()+"")
            brealc
回复

使用道具 举报

1

主题

33

帖子

1089

积分

金牌会员

Rank: 6Rank: 6

积分
1089
发表于 2021-12-12 11:39:58 | 显示全部楼层

回帖奖励 +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
回复

使用道具 举报

4

主题

49

帖子

2119

积分

金牌会员

Rank: 6Rank: 6

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

回帖奖励 +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
复制代码


回复

使用道具 举报

13

主题

109

帖子

984

积分

高级会员

sgsdgsg

Rank: 4

积分
984
发表于 2021-12-12 11:38:38 | 显示全部楼层

回帖奖励 +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
复制代码
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-2 11:23 , Processed in 0.041865 second(s), 25 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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