找回密码
 中文实名注册
查看: 209|回复: 7

Python作业 曹家睿

[复制链接]

3

主题

19

帖子

1219

积分

金牌会员

Rank: 6Rank: 6

积分
1219
发表于 2024-4-6 11:11:47 | 显示全部楼层 |阅读模式
def cal(days):
    result = 2 ** days
    print(result)
    return result


if cal(10) < 100:
    print('问题不大')
else:
    print('出大事啦')
回复

使用道具 举报

3

主题

19

帖子

1219

积分

金牌会员

Rank: 6Rank: 6

积分
1219
 楼主| 发表于 2024-4-13 11:53:50 | 显示全部楼层
[Python] 纯文本查看 复制代码
def jump(height, planet):
    if planet == '月球':
        result = height * 6
    if planet == '火星':
        result = height * 2.5
    if planet == '木星':
        result = height * 0.4
    sentence = '你可以在' + planet +'跳' + str(result) + '米'
    print(sentence)


jump(1,'火星')
回复

使用道具 举报

3

主题

19

帖子

1219

积分

金牌会员

Rank: 6Rank: 6

积分
1219
 楼主| 发表于 2024-4-27 11:38:25 | 显示全部楼层
[Python] 纯文本查看 复制代码
import api
status = '聊天'
while status == '聊天':
    question = input('帅气的孙小弟:')
    answer = ari.chat(question)
    print('奥普尔号:' + answer)
    if question == '再见':
        status = '停止'
回复

使用道具 举报

3

主题

19

帖子

1219

积分

金牌会员

Rank: 6Rank: 6

积分
1219
 楼主| 发表于 2024-4-27 11:39:15 | 显示全部楼层
[Python] 纯文本查看 复制代码
[mw_shl_code=python,true]import api
status = '聊天'
while status == '聊天':
    question = input('帅气的孙小弟:')
    answer = ari.chat(question)
    print('奥普尔号:' + answer)
回复

使用道具 举报

3

主题

19

帖子

1219

积分

金牌会员

Rank: 6Rank: 6

积分
1219
 楼主| 发表于 2024-4-27 11:40:31 | 显示全部楼层
[Python] 纯文本查看 复制代码
import api
status = '聊天'
while status == '聊天':
    question = input('帅气的孙小弟:')
    answer = ari.chat(question)
    print('奥普尔号:' + answer)
    if question == '再见':
        status = '停止'
回复

使用道具 举报

3

主题

19

帖子

1219

积分

金牌会员

Rank: 6Rank: 6

积分
1219
 楼主| 发表于 2024-4-27 11:41:40 | 显示全部楼层
曹家睿 发表于 2024-4-13 11:53
[Python] 纯文本查看 复制代码
def jump(height, planet):
    if planet == '月球':
        result = height  ...[/quote]

[mw_shl_code=python,true]import api
status = '聊天'
while status == '聊天':
    question = input('帅气的孙小弟:')
    answer = ari.chat(question)
    print('奥普尔号:' + answer)
    if question == '再见':
        status = '停止'
回复

使用道具 举报

3

主题

19

帖子

1219

积分

金牌会员

Rank: 6Rank: 6

积分
1219
 楼主| 发表于 2024-6-1 11:07:41 | 显示全部楼层
[Python] 纯文本查看 复制代码
meter = 0
while True:
    meter = meter + 5
    if meter >= 50:
        print('我终于出来了')
        break
    meter = meter - 4
回复

使用道具 举报

3

主题

19

帖子

1219

积分

金牌会员

Rank: 6Rank: 6

积分
1219
 楼主| 发表于 2024-6-1 11:09:31 | 显示全部楼层
[Python] 纯文本查看 复制代码
meter = 0
day = 0
while True:
    day = day + 1
    meter = meter + 5
    if meter >= 50:
        print('我终于出来了')
        break
    meter = meter - 4
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-8 10:42 , Processed in 0.039233 second(s), 29 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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