Ask coding questions

← Back to all posts
How to fit input statements in if statements python?
ChrystomThalapp (1)

So I'm trying to make a text adventure game and is it possible to fit input() in if statements?

Answered by JULIODIAZ1 (45) [earned 5 cycles]
View Answer
Comments
hotnewtop
JULIODIAZ1 (45)
print("Enter your name please!")
name = input()


print("Hello "+ name)

print("Where do you to go?", "Left or Right?")

x = input()
if x == "something":
 #code goes here
Coder100 (16757)

sure?

if input("say hello: ") == "hello":
  print("you said hello")