0% found this document useful (0 votes)
10 views8 pages

PM File (1-8) Prints

Uploaded by

Shubham Goel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views8 pages

PM File (1-8) Prints

Uploaded by

Shubham Goel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

PRACTICAL 1

Output:

PRACTICAL 2
PRACTICAL 3
Using seed()

# importing "random" for random operations

import random

# using random() to generate a random number

# between 0 and 1

print("A random number between 0 and 1 is : ", end="")

print(random.random())

# using seed() to seed a random number

random.seed(5)

# printing mapped random number


Using randrange()
print("The mapped random number with 5 is : ", end="")

print(random.random())

# using seed() to seed di erent random number

random.seed(7)

# printing mapped random number

print("The mapped random number with 7 is : ", end="")

print(random.random())

# using seed() to seed to 5 again

random.seed(5)

# printing mapped random number

print("The mapped random number with 5 is : ", end="")

print(random.random())

# using seed() to seed to 7 again

random.seed(7)

# printing mapped random number

print("The mapped random number with 7 is : ", end="")

print(random.random())

PRACTICAL 4
PRACTICAL 5
PRACTICAL 6
PRACTICAL 7
PRACTICAL 8

You might also like