+ 1
why is my code not working
num = 1 if num == 1: print("hi") two = 2 if two == 2: print("bye") import random print(random.randint(1,2))
7 Answers
+ 2
import random
num = random.randint(1,2) #generate a num
print(num) #check what it returned by print
if num == 1:
print("hi")
elif num == 2:
print("bye")
# if it is 1 print hi else if it is 2 print bye
#hope it helps...
0
What not working in code?
0
Yones Mussa its supposed to say if the randomizer hits 1, it prints hi, if it hits 2, it prints hi as the output, im a beginner so im sorry if this question sounds stupid
0
Thanks a lot!
0
I hope this will work!
0
Read comments in code to understand.
You're welcome..
- 1
Whats not working