Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
56 lines (42 loc) · 1.22 KB

File metadata and controls

56 lines (42 loc) · 1.22 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# _*_ coding:utf-8 _*_
import random
import string
def generate_random_num_str(length):
return ''.join(random.choice(string.letters) for i in range(length))
def get_random_int():
# n -> [0, 10]
n = random.randint(0, 10)
print n
print random.randint(180, 200)
def rand_range():
print random.randrange(1, 100)
# like 23
print random.randrange(0, 100, 10)
# 20
print random.randrange(0, 100, 10)
# 90
def random_seed():
sd = 3
random.seed(sd)
print "Random number with seed 10 : ", random.random()
# It will generate same random number(do random.seed(sd) every time before)
random.seed(sd)
print "Random number with seed 10 : ", random.random()
# It will generate same random number
random.seed(sd)
print "Random number with seed 10 : ", random.random()
if __name__ == '__main__':
# random_seed()
# rand_range()
# get_random_int()
# print random.choice(string.letters)
# f
# print generate_random_num_str(5)
# bjSQU
# print string.letters
# abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
import time
t = int(time.time())
print random.randint(1000000, 100000000)
print random.choice([1, 3, 5, 7])
pass
Morty Proxy This is a proxified and sanitized view of the page, visit original site.