-
Notifications
You must be signed in to change notification settings - Fork 0
/
Python Random Numbers.py
118 lines (105 loc) · 1.91 KB
/
Python Random Numbers.py
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import random
def my_random():
return 4*random.random()+3
for i in range(10):
print(my_random())
"""3.4856862328836837
3.647966876040775
4.697884915072255
3.720555588056461
3.222445848089867
3.9127506104428744
6.975506933383981
5.654631751248507
4.045494195701494
4.640625693350366"""
for i in range(10):
print(random.uniform(3,7))
"""4.893551714924643
3.005203731626983
3.9576070093060642
5.739179760126305
4.231708556574638
6.0804849282481115
4.141089147867866
3.7552099978780635
4.060638233963244
3.9895022740163077
3.791379930286165
3.552961831114522
4.0627539506152885
6.043879753119263
6.624320600220095
6.965435682328609
5.297335532787619
3.0039702305126403
3.8271824784964004
5.33631999201475"""
for i in range(20):
print(random.normalvariate(0,1))
"""3.2907083468489553
6.3731278242251586
3.1518552692871884
5.692509436597127
6.297566766778425
5.1323649807166545
3.097957123987852
5.829354159981089
5.337261260570996
3.4950865624617204
5.958275021667236
6.001758201675922
3.2385626818413082
5.61949274785575
6.31184340617745
3.9390262777956844
3.0090452263676304
5.890178731660891
6.970248598449119
4.18876562765141
-0.33057695221741734
0.4234960049051295
-1.8939122519840164
-1.438752266201636
0.025538012878681324
-0.8777523623197501
0.5925445847781634
0.8244064627013841
-0.2997734235342775
-0.021682122575865107
-1.4613522816576323
0.29891500298782725
-1.1308032538199075
0.5137562849723704
-0.5884333103570237
0.49357897083986274
-2.103734466449738
1.3260663360310676
-1.3033342095209668
0.6899766706575767"""
for i in range(10):
print(random.randint(1,6))
"""2
1
2
2
2
5
2
3
5
3"""
#Random Element from a list
outcomes=['rock','paper','scissors']
for i in range(10):
print(random.choice(outcomes))
"""scissors
paper
scissors
scissors
rock
rock
scissors
paper
paper
scissors"""