摘要: product_list = [('shoe',1299), ('book',68), ('pad',2999), ('char',249), ('switch',1499), ('iwatch',3270), ] shopping_list =[] salary = input("input yo 阅读全文
posted @ 2020-02-22 22:02 七九灰 阅读(162) 评论(0) 推荐(0)
摘要: 数列的一些增删改查操作 import copy names = ["aa","bb","cc","dd"] print(names) print(names[1],names[2]) print(names[0:2])#切片,要头不要尾 print(names[:2])#和上一个结果一样 print 阅读全文
posted @ 2020-02-19 23:01 七九灰 阅读(425) 评论(0) 推荐(0)
摘要: 数据转换基本模式: 代码: msg = "我爱爬虫" print(msg) print(msg.encode(encoding="utf-8")) print(msg.encode(encoding="utf-8").decode(encoding="utf-8"))#把string类型转换成byt 阅读全文
posted @ 2020-02-18 21:24 七九灰 阅读(151) 评论(0) 推荐(0)
摘要: 猜年龄小游戏: age = 24 count = 0 while count < 3: guess_age = int(input("guess age:")) if guess_age == age: print("yes ,you got it") break elif guess_age > 阅读全文
posted @ 2020-02-16 14:35 七九灰 阅读(248) 评论(0) 推荐(0)