摘要: #字典:key-value格式,大括号,逗号,冒号#声明字典 adic = {1:"lnsoft", "dep": "dev center", "name":"Linda", "address": "Wanda"} print(adic) #访问单元素 print(adic["dep"] ) #更新元素 adic["dep"] = "sales" print(adic) #新增 ad... 阅读全文
posted @ 2019-07-15 16:50 lx_yykl 阅读(156) 评论(0) 推荐(0) 编辑
摘要: #猜价钱 trueprice = 202 price = input("Please guess the price:") while (int(price) != trueprice): if(int(price) > trueprice): price = input("Your price is higher,Please try again:") else... 阅读全文
posted @ 2019-07-15 16:39 lx_yykl 阅读(1002) 评论(0) 推荐(0) 编辑
摘要: #模拟登录,依次输入用户名、密码,最多三次机会 userd = ['Linda', '123456'] while 1: username = input("Please input the username:") if username in userd: break else: print("your username is wron... 阅读全文
posted @ 2019-07-15 16:36 lx_yykl 阅读(1097) 评论(0) 推荐(0) 编辑
摘要: 结果: *****九九乘法表*****1*1=1 1*2=2 2*2=4 1*3=3 2*3=6 3*3=9 1*4=4 2*4=8 3*4=12 4*4=16 1*5=5 2*5=10 3*5=15 4*5=20 5*5=25 1*6=6 2*6=12 3*6=18 4*6=24 5*6=30 6 阅读全文
posted @ 2019-07-15 16:33 lx_yykl 阅读(176) 评论(0) 推荐(0) 编辑