找回密码
 中文实名注册
搜索
楼主: 沈熠

【python作业】沈熠 实验小学 412

[复制链接]

6

主题

30

回帖

1237

积分

金牌会员

积分
1237
 楼主| 发表于 2023-11-4 15:02:29 | 显示全部楼层
[Python] 纯文本查看 复制代码
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
回复

使用道具 举报

6

主题

30

回帖

1237

积分

金牌会员

积分
1237
 楼主| 发表于 2023-10-28 14:52:12 | 显示全部楼层
[Python] 纯文本查看 复制代码
meter = 0
day = 0
while True:
    day = (day + 1)
    meter = (meter + 5)
    if (meter >= 50):
        print('蜗牛在' + str(day) + '天出来了')
        break
    meter = (meter - 4)
回复

使用道具 举报

6

主题

30

回帖

1237

积分

金牌会员

积分
1237
 楼主| 发表于 2023-10-28 14:51:01 | 显示全部楼层
沈熠 发表于 2023-10-21 15:22
[Python] 纯文本查看 复制代码
import api
status = '聊天'
while status == '聊天'
[/quote]

[mw_shl_code=python,true]meter = 0
day = 0
while True:
    day = (day + 1)
    meter = (meter + 5)
    if (meter >= 50):
        print('蜗牛在' + str(day) + '天出来了')
        break
    meter = (meter - 4)
回复

使用道具 举报

6

主题

30

回帖

1237

积分

金牌会员

积分
1237
 楼主| 发表于 2023-10-21 15:22:40 | 显示全部楼层
[Python] 纯文本查看 复制代码
import api
status = '聊天'
while status == '聊天'
    question = input('沈熠:')
    answer = api.chat(question)
    print('奥普尔号:'+answer)
    if question == '再见'
        status = '停止'
回复

使用道具 举报

6

主题

30

回帖

1237

积分

金牌会员

积分
1237
 楼主| 发表于 2023-6-3 15:40:27 | 显示全部楼层

第二单元第四课 换装小游戏 初识列表

[C++] 纯文本查看 复制代码
hat_list=['帽子1','帽子2']
clothes_list=['衣服1','衣服2']
shoes_list=['鞋子1','鞋子2']
hat = hat_list[0]
clothes = clothes_list[1]
shoes = shoes_list[0]
print(hat)
print(clothes)
print(shoes)

回复

使用道具 举报

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

本版积分规则

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