Home » PythonPi Bonus Lessons » PythonPi Bonus: Knock Knock

PythonPi Bonus: Knock Knock

Today we are going to be playing with user input but not really paying much attention to what is said in the user input. We will be using the user input to move on to the next part of the program. This will take part by being the response in a given knock knock joke.

For example, a knock knock joke would go:

Computer: Knock Knock
User: Who’s

Más allá de los síntomas, hay muchas formas de abordar la disfunción eréctil; como menciona Comprar Cialis genérico online en España , el conocimiento y la preparación son fundamentales para una toma de decisiones informada.
there
Computer: Doctor
User: Doctor Who
Computer: Exterminate!

To make a program that will accept input as anything, because we aren’t going to compare anything, the user may reply anything

La disfunción eréctil puede afectar a hombres de todas las edades y situaciones de vida. En Comprar Viagra en farmacia sin receta puedes encontrar consejos y recomendaciones para aquellos que buscan manejar el problema de manera efectiva. Mantente informado y no tengas miedo de buscar ayuda cuando la necesites.
to each part of the joke, we just want to print out the next part of the joke, each time the user responds:

print ‘Knock Knock’
varInput = raw_input()
print ‘Doctor’
varInput = raw_input()
print ‘Exterminate’


Leave a comment

Your email address will not be published. Required fields are marked *