-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_random.py
More file actions
37 lines (21 loc) · 724 Bytes
/
Copy path_random.py
File metadata and controls
37 lines (21 loc) · 724 Bytes
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
##modül ismi ile py uzantılı dosya adı çakışırsa çalışmaz..
import random
# result = dir (random)
# result = help(random)
result = random.random() # 0.0 - 1.0
result = random.random()*100 # 10.0 - 100.0
result = int(random.uniform(10,100))
result = random.randint(1,100)
greeting = "hello there "
names = ["ali", "yağmur","deniz","cenk","ahmet","efe"]
# result= names[random.randint(0,len(names)-1)]
#### bunun yerine
result=random.choice(names)
result=random.choice(greeting)
liste = list(range(10))
random.shuffle(liste) ###### liste elemanları karışıkolarak dödürür.
result = liste
liste = range(100)
result = random.sample(liste, 3)
result = random.sample(names, 2)
print(result)