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

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

[复制链接]

10

主题

51

回帖

-270

积分

限制会员

sgsdgsg

积分
-270
发表于 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)
回复

使用道具 举报

4

主题

35

回帖

-183

积分

限制会员

积分
-183
发表于 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
回复

使用道具 举报

4

主题

35

回帖

-183

积分

限制会员

积分
-183
发表于 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
回复

使用道具 举报

0

主题

17

回帖

-246

积分

限制会员

积分
-246
发表于 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

主题

22

回帖

1631

积分

金牌会员

积分
1631
发表于 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)
回复

使用道具 举报

2

主题

27

回帖

823

积分

高级会员

积分
823
发表于 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

主题

22

回帖

1631

积分

金牌会员

积分
1631
发表于 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)
回复

使用道具 举报

4

主题

49

回帖

142

积分

注册会员

积分
142
发表于 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)
回复

使用道具 举报

15

主题

48

回帖

-158

积分

版主

你爸爸

积分
-158
发表于 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)


回复

使用道具 举报

2

主题

21

回帖

-172

积分

限制会员

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

回帖奖励 +40 金钱

import api
city = '东台'
phone = '13730261971'
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)
回复

使用道具 举报

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

本版积分规则

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