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

【Python作业】第四单元 第7课 短信小助手 巧用API

[复制链接]

15

主题

57

帖子

3170

积分

论坛元老

Rank: 8Rank: 8

积分
3170
发表于 2022-2-27 11:45:34 | 显示全部楼层

回帖奖励 +40 金钱

import api

city=""
phone=""
name=""
temp = api.get_temp(city)

result=""
if temp > 25:
    result=""
elif temp >18:
    result=""
else:
    result=""

content = f"...{city}...{temp}...,"+result
api.send(phone.name.content)
回复

使用道具 举报

13

主题

109

帖子

984

积分

高级会员

sgsdgsg

Rank: 4

积分
984
发表于 2022-2-27 11:45:26 | 显示全部楼层

回帖奖励 +40 金钱

[Python] 纯文本查看 复制代码
import api

city = '东台'
phone = '13615167300'
name = '你爸爸'
temp = api.get_temp(city)

result = ''
if temp >25:
    result = '天气热'
elif temp>18:
    result = '适中'
else:
    result='低'
    
content = f'今天{city}的气物是{temp}result
api.send(phone, name, content)
回复

使用道具 举报

5

主题

69

帖子

2243

积分

金牌会员

Rank: 6Rank: 6

积分
2243
发表于 2022-2-27 11:45:25 | 显示全部楼层
import api
city = '成都'
phone = '***********'
name = ' 孙小弟'
temp = api.get_temp(city)
result = ''
if temp > 25:
    result = '很热,防暑'
elif temp >18:
    result = '适中'
else:
    result = '过低,保暖'
content = f'今天{city}的气温是{temp}度,'+ result
回复

使用道具 举报

5

主题

69

帖子

2243

积分

金牌会员

Rank: 6Rank: 6

积分
2243
发表于 2022-2-27 11:43:13 | 显示全部楼层

回帖奖励 +40 金钱

import api
city = '成都'
phone = '***********'
name = ' 孙小弟'
temp = api.get_temp(city)
result = ''
if temp > 25:
    result = '很热,防暑'
elif temp >18:
    result = '适中'
else:
    result = '过低,保暖'
content = f'今天{city}的气温是{temp}度,'+ result
回复

使用道具 举报

1

主题

33

帖子

1089

积分

金牌会员

Rank: 6Rank: 6

积分
1089
发表于 2022-2-27 11:43:13 | 显示全部楼层

回帖奖励 +40 金钱

import api

city = '成都'
phone = '111'
name = '马牛逼'
temp = api.get_temp(city)

result = ''
if temp > 25:
    result = '热'
elif temp > 18:
    result = '中'
else:
    result = '冷'

content = f'今天{city}的气温是{temp}度' + result
api.send(phone,name,content)
回复

使用道具 举报

1

主题

32

帖子

1790

积分

金牌会员

Rank: 6Rank: 6

积分
1790
发表于 2022-2-27 10:15:47 | 显示全部楼层
import api

city = '东台'
phone = '760'
name = '老妈'
temp = api.get_temp(city)

result = ''
if temp > 25:
    result =  '热'
if temp > 18:
    result = '中'
else:
    result = '低'

content = f'今天{city}的气物是{temp}result
api.send(phone,name,content)
回复

使用道具 举报

3

主题

48

帖子

1009

积分

金牌会员

Rank: 6Rank: 6

积分
1009
发表于 2022-2-27 10:15:33 | 显示全部楼层

回帖奖励 +40 金钱

imput api
city = '成都'
phone = '***********'
name = '孙小弟'
temp = api.get_temp(city)
result = ''
if temp>25:
    result = '太热'
elif temp>18:
    result = '正好'
else:
    result = '太冷'
content = f'今天{city}是{temp}度'
api.send(phone,name,content)


回复

使用道具 举报

1

主题

32

帖子

1790

积分

金牌会员

Rank: 6Rank: 6

积分
1790
发表于 2022-2-27 10:15:14 | 显示全部楼层

回帖奖励 +40 金钱

import api

city = '东台'
phone = '760'
name = '老妈'
temp = api.get_temp(city)

result = ''
if temp > 25:
    result =  '热'
if temp > 18:
    result = '中'
else:
    result = '低'

content = f'今天{city}的气物是{temp}result
api.send(phone,name,content)
回复

使用道具 举报

5

主题

63

帖子

321

积分

中级会员

Rank: 3Rank: 3

积分
321
发表于 2022-2-27 10:15:14 | 显示全部楼层

回帖奖励 +40 金钱

import api
city = '东台'
phone = '111111111111111111111111111111111111111111111111111111111111110'
name = '警察'
temp = api.get_temp(city)
result =''
if temp > 25:
    result = '天气很热'
elif temp > 18:
    result = '温度正常'
else:
    result = '天气很冷'
content = f'今天{city}的气温是{temp}度'
api.send(phone,name,content)
回复

使用道具 举报

17

主题

82

帖子

4444

积分

版主

你爸爸

Rank: 7Rank: 7Rank: 7

积分
4444
发表于 2022-2-27 10:07:36 | 显示全部楼层

回帖奖励 +40 金钱

import api
city = '东台'
phone = '18662023306'
name = '曹帅'
temp = api.get_temp(city)
result=''
if temp >25:
    result = '很热'
elif temp > 18:
    result = '正好'
else:
    result = '很冷'
content = f'今天{city}的气温{temp}度,'+result
api.send(phone,name,content)


回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-2 21:20 , Processed in 0.041570 second(s), 23 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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