Repository navigation
Expand file tree
/
Copy pathRandom_2.py
More file actions
66 lines (41 loc) · 1.37 KB
/
Copy pathRandom_2.py
File metadata and controls
66 lines (41 loc) · 1.37 KB
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
# import random
# print("Generating 3 random integer number between 100 and 999 divisible by 5")
# for x in range(3):
# print(random.randrange(100, 999, 5), end=', ')
# import random
# lottery_tickets = []
# for x in range(100):
# lottery_tickets.append(random.randrange(10000000000, 9000000000000))
# winners = random.sample(lottery_tickets, 2)
# print(winners)
# import random
# name = 'hello'
# char = random.choice(name)
# print(char)
# import random
# import string
# def randomString(stringLength):
# """Generate a random string of 5 charcters"""
# letters = string.ascii_letters
# return ''.join(random.choice(letters) for i in range(stringLength))
# print ("Random String is ", randomString(5) )
# import random
# import string
# def randomPassword():
# randomSource = string.ascii_letters + string.digits + string.punctuation
# password = random.sample(randomSource, 6)
# password += random.sample(string.ascii_uppercase, 2)
# password += random.choice(string.digits)
# password += random.choice(string.punctuation)
# passwordList = list(password)
# random.SystemRandom().shuffle(passwordList)
# password = ''.join(passwordList)
# return password
# print ("Password is ", randomPassword())
import random
num1 = random.random()
print(num1)
num2 = random.uniform(9.5, 99.5)
print(num2)
num3 = num1 * num2
print(num3)