We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5b1ad2c commit 82da89bCopy full SHA for 82da89b
1 file changed
illuz/0001/key_generator.py
@@ -0,0 +1,27 @@
1
+#!/usr/bin/python
2
+# -*- coding: utf-8 -*-
3
+# Author: illuz <iilluzen[at]gmail.com>
4
+# File: key_generator.py
5
+# Create Date: 2015-02-09 10:43:36
6
+# Descripton: Use uuid module to generate 200 register keys.
7
+# Usage: key_generator.py
8
+
9
+"""
10
+第 0001 题:
11
+做为 Apple Store App 独立开发者,你要搞限时促销,为你的应用生成激活码(或者优惠券),使用 Python 如何生成 200 个激活码(或者优惠券)?
12
13
14
+from uuid import uuid4
15
16
+def generate_key(num):
17
+ key_list = [str(uuid4()) for i in range(num)]
18
+ return key_list
19
20
21
+def main():
22
+ print generate_key(200)
23
24
25
+if __name__ == '__main__':
26
+ main()
27
0 commit comments