import
random
print
(
"random():"
, random.random())
print
(
"randint(1000, 9999):"
, random.randint(
1000
,
9999
))
print
(
"randrange(0, 21, 2):"
, random.randrange(
0
,
21
,
2
))
print
(
"uniform(0, 20):"
, random.uniform(
0
,
20
))
list_string
=
[
'a'
,
'b'
,
'c'
,
'd'
,
'e'
]
print
(
"choice(list):"
, random.choice(list_string))
print
(
"choice(string):"
, random.choice(
'abcd'
))
list_number
=
[
1
,
2
,
3
,
4
,
5
]
random.shuffle(list_number)
print
(
"shuffle(list):"
, list_number)
print
(
"sample(sequence):"
, random.sample(
'abcdefg'
,
2
))