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

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

[复制链接]

1

主题

24

帖子

899

积分

高级会员

Rank: 4

积分
899
发表于 2021-12-11 19:16:05 | 显示全部楼层

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

使用道具 举报

7

主题

77

帖子

109

积分

注册会员

Rank: 2

积分
109
发表于 2021-12-11 19:11:54 | 显示全部楼层

回帖奖励 +40 金钱

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

使用道具 举报

10

主题

153

帖子

3079

积分

论坛元老

河豚绿植

Rank: 8Rank: 8

积分
3079
发表于 2021-12-11 19:10:08 | 显示全部楼层

回帖奖励 +40 金钱

  1. tree = 0
  2. total = 0
  3. while True:
  4.     tree+=1
  5.     if tree%3 != 0:
  6.         total+=tree
  7.     if total >= 120:
  8.         print('第'+str(tree)+'棵树可以摘完120个桃子')
  9.         break
复制代码
回复

使用道具 举报

0

主题

2

帖子

147

积分

注册会员

Rank: 2

积分
147
发表于 2021-12-11 15:33:29 | 显示全部楼层

回帖奖励 +40 金钱

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

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

使用道具 举报

0

主题

13

帖子

456

积分

中级会员

Rank: 3Rank: 3

积分
456
发表于 2021-12-11 15:31:03 | 显示全部楼层

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

使用道具 举报

2

主题

30

帖子

715

积分

高级会员

Rank: 4

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

回帖奖励 +40 金钱

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

使用道具 举报

0

主题

13

帖子

456

积分

中级会员

Rank: 3Rank: 3

积分
456
发表于 2021-12-11 15:14: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)+'桃子摘够了')
    berak
回复

使用道具 举报

5

主题

67

帖子

1103

积分

金牌会员

Rank: 6Rank: 6

积分
1103
发表于 2021-12-11 15:13:08 | 显示全部楼层
tree=0
total=0
While Frue
    tree=tree+1
    if tree%3=0totai
    print(tree)
    print(total)
    if total>=120
        print(de+strh)
    brenk
回复

使用道具 举报

3

主题

44

帖子

922

积分

高级会员

Rank: 4

积分
922
发表于 2021-12-11 15:08:18 | 显示全部楼层
tree = 0
total = 0

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

使用道具 举报

3

主题

44

帖子

922

积分

高级会员

Rank: 4

积分
922
发表于 2021-12-11 15:07:46 | 显示全部楼层

回帖奖励 +40 金钱

tree = 0
total = 0
while tree:
    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 12:00 , Processed in 0.063211 second(s), 24 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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