Linked Questions

Popular Questions

What have I done wrong with programming a multiple choice game

Asked by At

I'm trying to create a game and cant get the y/n function to work

I've tried the code below and it says y is not defined or it will just skip asking and print ("Lets go!")

import time
name = input ("Hello, what is your name?")
print ("Hello," +name)
time.sleep(1)
print ("ready to play? [y/n]")
y = print ("Let's go!")

Here's how it should look like:

Hello, what is your name? xyz
Hello, xyz
ready to play? [y/n] y
Let's go!

I wanted it to wait for my input of either y or n before it said ("Let's go!")

Related Questions