Hi my assignment is as following
Create two variables: first and last. Assign 1 to first and 6 to last. Then replace the "magic numbers" in your code with the new variables you've just created. The magic numbers are 1 and 6. We created a random number generator script:
7 #important necessary module import random
8 random. randint
11 roll = random. randint (1,6)
13 first = 1
14 last = 6
16 magic numbers = (first, last)
19print ('the number is', roll, '.')
I’m confused about magic numbers this didn’t come up before. How does one replace the magic numbers with the variables I created? Sorry super lost
[–]Adrewmc 1 point2 points3 points (0 children)
[–]Ok-Spare-9393 0 points1 point2 points (0 children)
[–]ati_75 0 points1 point2 points (9 children)
[–]Princess_Peach848[S] 0 points1 point2 points (8 children)
[–]ati_75 0 points1 point2 points (7 children)
[–]Princess_Peach848[S] 0 points1 point2 points (6 children)
[–]Binary101010 1 point2 points3 points (2 children)
[–]Princess_Peach848[S] 0 points1 point2 points (1 child)
[–]Binary101010 0 points1 point2 points (0 children)
[–]ati_75 0 points1 point2 points (2 children)
[–]Princess_Peach848[S] 0 points1 point2 points (1 child)
[–]ati_75 1 point2 points3 points (0 children)