- 博客(5)
- 资源 (1)
- 收藏
- 关注
原创 计算均值方差的程序
lists=[]for i in range(0,99): print("你可以输入'q'来结束循环") x=str(input('please enter number: ')) if x=='q': break else: lists.append(x)n =int(len(lists))print('n={}'.format(n))num=0for j in lists: j=float(j) num += j# p
2021-04-23 22:01:42
828
1
原创 爬虫入门实战:爬取肯德基餐厅位置信息
import requestsif __name__=='__main__': url = 'https://www.kfc.com.cn/kfccda/ashx/GetStoreList.ashx?op=keyword' headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.43
2021-03-13 15:06:00
646
原创 python从入门到实践9-4~9-5
9-4就餐人数class Car: def __init__(self, name, year,model): self.name= name self.year = year self.model = model self.odometer_reading=4 pass def get_descriptive_name(self): t_car = self.name + str(sel
2021-02-18 21:14:51
130
原创 python从入门到实践9-1~9-3
9-1餐馆class Restaurant(): def __init__(self, restaurant_name, cuisine_type): self.name = restaurant_name self.type = cuisine_type def describe_restaurant(self): print("This restaurant's name is : " + self.name.title())
2021-02-18 16:31:52
104
原创 python编程从入门8-12~8-14
8-12三明治def sandwichs(name): print('This is your ' + name + ' sandwich') passsandwichs('salad')sandwichs('tuna')sandwichs('tomato')8-13用户简介def build_profile(first, last, **user_info): profile= {} profile['first_name']=first prof
2021-02-16 17:51:41
224
1
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人