![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 77
负欲
这个作者很懒,什么都没留下…
展开
-
2021-01-08
python人物名称配对相亲实验生成1000男女假人,为其配对找到合适对象随机设置假人的姓名,性别(0代表男,1代表女),城市,薪水 采用split+通过random函数实现;采用循环生成1000假人,生成采用了列表嵌套字典即列表中存放了1000条字典数据;通过双重循环随机配对,配对成功即break(破出循环);在配对过程中要注意男-女配对的问题,将(1-sex)即可得到需要的另外一个性别。#coding:UTF-8from random import random, choice,randint原创 2021-01-08 09:22:15 · 10127 阅读 · 0 评论 -
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 libararys:dic.writel原创 2021-01-08 09:09:19 · 385 阅读 · 0 评论