![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
m0_53866948
这个作者很懒,什么都没留下…
展开
-
python client和server实验
import socketClient = socket.socket()#建立clientClient.connect((“127.0.0.1”,9099))while True:msg = input(“请输入你想给客户发送的消息:”)if msg == “exit”:breakClient.sendall(msg.encode(“utf-8”))data = Client.recv(1024)#0100011110011print(data.decode(encoding=“utf-原创 2021-01-07 21:29:19 · 382 阅读 · 0 评论 -
python石头剪刀布小实验
strl = input(“请出剪刀。石头,或布:”)if strl == “剪刀”:print(“我出石头”)elif strl == “石头”:print(“我出布”)elif strl == “布”:print(“我出剪刀”)else:print(“执行这个”)print(“执行到这里”)...原创 2021-01-07 21:22:18 · 247 阅读 · 0 评论 -
python增删改查实验2021-1-7
#增删改查dict1={“name”:“张三”,“sex”:“男”,“age”:56,“clothes”:“冬装”}dict1[“clothes”]=“夏装”print(dict1)dict1[“glasses”]=Trueprint(dict1)dict1[“Monday”]=“over 1 billion”print(dict1)dict1[“NickName”]=“砖石王老五”print(dict1)del dict1[“NickName”]#删除print(dict1)dic原创 2021-01-07 19:02:58 · 113 阅读 · 0 评论 -
python数字猜谜实验2021-1-16
#数字猜谜def jingling(ball,level,hp):if ball==“大师球”:rollcoin=100return"捕捉到小精灵"elif ball==“高级球”:rollcoin=random.randint(70,100)elif ball==“普通球”:rollcoin = random.randint(40,90)if level>80:rollcoin=rollcoin-5if hp > 80:rollcoin=rollcoin-20if r原创 2021-01-06 21:42:27 · 127 阅读 · 0 评论 -
python小黑屋实验
import randomimport timeEVENT = [“衣衫褴褛的人”,“马保国”,“xxx”]SOURCE = [“木材”,“肉”,“布”]SKILL = [“降龙十八掌”,“打狗棍法”,“九阳真经”,“如来神掌”]def Init():person = {“HP”:100, “Huangry”:100, “IQ”:100,“skill”:"",“木材”:0, “fire”:0}time.sleep(1)print(“人物生成中>>>>>>原创 2021-01-06 13:54:40 · 161 阅读 · 0 评论 -
python字典攻击小实验
import itertoolsimport datetimeimport hashlibimport timedef generatelibary(library, length=6):libararys = itertools.product(library,repeat=length)dic = open(“paswordlirbarys.txt”,“w”,encoding=‘utf-8’)for i in libararys:dic.writelines(i)dic.writeli原创 2021-01-04 13:49:45 · 150 阅读 · 0 评论 -
2021-01-03
class parent:def init(self,name,sex):self.nsme = nameself.sex = sexdef study(self):print(“人生来就会学习”)class son(parent):def study(self,str1,str2):print(“这个小傻非常喜欢学习{},{}”.format(str1,str2))son1 = son(“小傻”,“人”)son1.hight = 150print(son1.hight)son1.s原创 2021-01-03 18:46:21 · 64 阅读 · 0 评论 -
python实验-简易版非诚勿扰
#coding:UTF-8#简陋版非诚勿扰#涉及到的待匹配数据#1.Sex(性别) 2.City(工作地区) 3.Age(年龄) (18-50) 4.Height(身高)(129-211) 5.Education(6选1)#6.marital_status 7.income(24000-600000)#8.name姓名 9.adim 对另一半要求import randomnametext=’’‘冰颖、成欢、惠镁、慧菲、加羽、初夏、雅香、语雪、初珍、白安、美铭、铭思、瑞翻、尚闻、细林、从雪、白原创 2021-01-02 20:24:12 · 204 阅读 · 0 评论 -
登录小实验
-- coding: utf-8 --“”"Created on Fri Feb 2 16:14:31 2018@author: Administrator一个简单的登录注册Demo“”"def showMessage():print(’—新建用户:(键入N/n)—’)print(’—登录帐号:(键入E/e)—’)print(’—退出程序:(键入Q/q)—’)def new_user():while True:myname = input(“请输入用户名:”)if myname原创 2021-01-02 14:55:57 · 155 阅读 · 0 评论