subject

I need to make this code work where it will print the 'I was also thinking about...' when I guess the correct number, at the moment when I guess the correct number it still prints as if I got it wrong. import random
num = random. randint(1,3)
# 9
answer = input("Pick a number from 1 to 3: ")
# hint: will the following if statment ever be executed even when the values of answer and num are the same? If not, can you fix the problem?
# hint: the error is not necessarily in the line below
if answer == num:
print("I'm also thinking about {} ".format(num))
print("You woke up from this dream.")
elif answer != num:
print("You fall into deep sand and get swallowed up. You lost!")
else:
print("You can't run away...")

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 07:30, barkonatree
What is the penalty for violating section 1201 of title 17 chapter 21 of the us code
Answers: 1
image
Computers and Technology, 23.06.2019 17:00, taytay1828
What are the 12 colors of the spectrum called?
Answers: 1
image
Computers and Technology, 23.06.2019 20:00, noah12345678
What multimedia system creates an immersive, real-life experience that the user can interact with?
Answers: 1
image
Computers and Technology, 24.06.2019 15:00, MilanPatel
In excel, what happens to the cell contents when you click and drag a cell into multiple cells?
Answers: 1
You know the right answer?
I need to make this code work where it will print the 'I was also thinking about...' when I guess th...

Questions in other subjects:

Konu
Mathematics, 17.11.2020 15:10