r/pythonhelp • • Aug 28 '21

HOMEWORK i need help with a random generator

so i made a script

import random

print(random.randint(1,5))

but how do i make it so that if 1 print ()

3 Upvotes

4 comments sorted by

1

u/Reddit_Snoofy Aug 28 '21

What do you mean with "so that if 1 pirnt()?? :p

1

u/reyu000 Aug 28 '21

what i mean is if 1 print (whatever)

1

u/Reddit_Snoofy Aug 28 '21

import random

value = random.randint(1, 5)

if value == 1:

____print("Whatever)

I think this is what you are lookinmg for. (Ignore the ____ its just so you can see the 1 indentation on the print)