Created
January 23, 2023 14:29
-
-
Save rhettre/1743fbcc8204306a839d29c0777adced to your computer and use it in GitHub Desktop.
Generate 5 random numbers. If you pass an integer seed into line 6 random.seed(), you will see that your results will always correspond to that seed number.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
print("---RANDOM NUMBERS---") | |
for i in range(5): | |
# Any number can be used in place of '0'. | |
random.seed(5) | |
# Generated random number will be between 1 to 1000. | |
print(random.randint(1, 1000)) | |
print("---END---") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment