找回密码
 中文实名注册
查看: 103|回复: 5

Python作业 曹家睿

[复制链接]

3

主题

13

帖子

1069

积分

金牌会员

Rank: 6Rank: 6

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


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

使用道具 举报

3

主题

13

帖子

1069

积分

金牌会员

Rank: 6Rank: 6

积分
1069
 楼主| 发表于 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

主题

13

帖子

1069

积分

金牌会员

Rank: 6Rank: 6

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

使用道具 举报

3

主题

13

帖子

1069

积分

金牌会员

Rank: 6Rank: 6

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

使用道具 举报

3

主题

13

帖子

1069

积分

金牌会员

Rank: 6Rank: 6

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

使用道具 举报

3

主题

13

帖子

1069

积分

金牌会员

Rank: 6Rank: 6

积分
1069
 楼主| 发表于 4 天前 | 显示全部楼层
曹家睿 发表于 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 = '停止'
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-1 13:36 , Processed in 0.040569 second(s), 28 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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