Random Numbers

PHOTO EMBED

Fri Nov 26 2021 09:45:49 GMT+0000 (Coordinated Universal Time)

Saved by @Sourabh #list #forloop #for #loop ##dictionary

# Import numpy as np
import numpy as np

# Set the seed
np.random.seed(123)

# Generate and print random float
print(np.random.rand())

#Roll The Dice
# Import numpy and set seed
import numpy as np
np.random.seed(123)

# Use randint() to simulate a dice
print(np.random.randint(1,7))
# Use randint() again
print(np.random.randint(1,7))


content_copyCOPY