Skip to content

Commit 3e0a5ba

Browse files
authored
Create 0001.py
1 parent d245f04 commit 3e0a5ba

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

woniuzhang/0001/0001.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import random
2+
import string
3+
4+
words = string.ascii_letters + string.digits
5+
6+
def get_coupon(digit):
7+
conpon = ''
8+
for i in range(digit):
9+
conpon += random.choice(words)
10+
return conpon
11+
12+
def two_hundred_coupons():
13+
# conpons = set()
14+
digit = 10
15+
for i in range(200):
16+
data = '%03d' % i ##数字编码放在最前面,保证验证码唯一性
17+
data += get_coupon(digit)
18+
# conpons.add(data)
19+
print(data)
20+
21+
two_hundred_coupons()

0 commit comments

Comments
 (0)