Skip to content

Instantly share code, notes, and snippets.

@rhettre
Created January 23, 2023 14:29
Show Gist options
  • Save rhettre/1743fbcc8204306a839d29c0777adced to your computer and use it in GitHub Desktop.
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.
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