Skip to content

Commit e99ea87

Browse files
committed
Create 0001.py
1 parent c563bcb commit e99ea87

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Liez-python-code/0001/0001.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
# coding = utf-8
3+
__author__= 'liez'
4+
5+
import random
6+
7+
def make_number(num, length):
8+
str = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
9+
a = []
10+
i = 0
11+
while i < num:
12+
numstr = ''
13+
for j in range(length):
14+
numstr += random.choice(str)
15+
if numstr not in a: #如果没重复
16+
a.append(numstr)
17+
i += 1
18+
print(numstr)
19+
20+
make_number(20,10)

0 commit comments

Comments
 (0)