- 博客(10)
- 收藏
- 关注
![](https://csdnimg.cn/release/blogv2/dist/pc/img/listFixedTop.png)
原创 python-假人随机匹配
import randomfor i in range(0,1000): nametext = '''黄子韬、肖战、迪丽热巴、蔡徐坤、郑恺、李晨、成龙、甄子丹、欧豪、鹿晗''' name = nametext.split("、") ChoiceName = name[int(random.random() * len(name))] print(ChoiceName) cityText = '''成都市,资阳市,巴中市,内江市,德阳市,美国,英国,法国,北京市,上海
2021-01-05 16:00:00
427
2
原创 用python实现表白
from turtle import *from time import sleepdef go_to(x, y): up() goto(x, y) down()def small_Circle(size): # 函数用于绘制心的小圆 speed(10) for i in range(210): forward(size) right(0.786)def big_Circle(size): # 函数用于绘制心的大圆
2021-01-07 19:58:08
3746
1
原创 python实验-找对象
class friend: def __init__(self,name,sex,facevalue,skill): self.name = name self.sex = sex self.facevalue = facevalue self.skill = skill def goodmorning(self): if self.sex == "女": print("老公,早上好")
2021-01-07 00:43:18
153
原创 python-99乘法表
for i in range(9): # 从0循环到8 i += 1 # 等价于 i = i+1 for j in range(i): # 从0循环到i j += 1 print(j, '*', i, '=', i * j, end=' ', sep='') print()
2021-01-06 20:01:47
592
原创 利用if-else-elif判断年份
year = int(input("请输入年份:"))if year % 4 == 0 and year%100!=0: print(year, "是普通闰年" )elif year % 400 == 0: print(year, "是世纪润年")else: print(year, "不是闰年")效果如下请输入年份:10001000不是闰年...
2021-01-06 19:46:02
358
原创 python-智能聊天实验
import socketServer = socket.socket()Server.bind(("127.0.0.1",9099))Server.listen(2)conn,address = Server.accept()while True: data = conn.recv(1024) print(data.decode(encoding="utf-8")) msg = input("请输入你想给客户端发送的消息:") if msg == "exit":
2021-01-06 11:38:33
113
原创 python登录注册实验
from faker import Fakerfake = Faker(locale='yy_CN') # 伪造中文数据print(fake.ssn())class Person: def __init__(self,yang_yin,sec_key): self.y_y = yang_yin self.sk = sec_key person_list = []for i in range(0,1000): yangyin = fake.name
2021-01-06 10:53:20
287
1
原创 python-小黑屋实验
import randomimport timeEVENT = ["破衣烂衫的人","沼泽","xxx"]#事件列表SOURCE = ["木材","肉","布"]#资源列表SKILL = ["降龙十八掌","打狗棒法","九阴真经","如来神掌"]#技能列表def Init():#初始人物 person = {"HP":100, "Hungry":100, "IQ":100, "skill":"", "木材":1, "fire":0
2021-01-06 10:43:47
239
原创 python-语句加密解密
str1 = "abcdefghi,.;:jklmnop!qrstuvwxyz12 346578ABCDEFGHIJKLMNOPQRSTUVWXYZ"str2 = "klmnopqr12s3t,A:5;B.X6DE8!FGH 7IJKL4MNOPQRSTUVWXYZuvwxyzabcdefghij"str3 = "tuvwxy1za2AB3XD7EFG8,.;:HI5JK6!LMNO4PQRS TUVWXYZbcdefghijklmnopqrs"str4 = "klmn1op3qr4ab5AB7XD,
2021-01-05 23:15:50
161
原创 python实验字典攻击
# 字典攻击import itertools # 迭代器import datetimeimport hashlibimport timedef generatelibary(library, length=8): libararys = itertools.product(library, repeat=length) dic = open("paswordlirbarys.txt", "w", encoding='utf-8') # 写模式打开文件 for i in
2021-01-05 15:21:17
103
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人