We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fec027c commit f57234eCopy full SHA for f57234e
2 files changed
ddkangfu/0000/507583.jpeg
39.4 KB
ddkangfu/0001/0001.py
@@ -0,0 +1,22 @@
1
+#coding=utf-8
2
+
3
+import uuid
4
5
+"""
6
+做为 Apple Store App 独立开发者,你要搞限时促销,为你的应用**生成激活码**(或者优惠券),使用 Python 如何生成 200 个激活码(或者优惠券)?
7
8
9
+def generate_activation_code(count):
10
+ code_list = []
11
+ for i in xrange(count):
12
+ code = str(uuid.uuid4()).replace('-', '').upper()
13
+ if not code in code_list:
14
+ code_list.append(code)
15
16
+ return code_list
17
18
19
+if __name__ == "__main__":
20
+ code_list = generate_activation_code(200)
21
+ for code in code_list:
22
+ print code
0 commit comments