Python - While Loops Tutorial 2 (Guessing Game)

preview_player
Показать описание
Learn how create a While loop in Python. In this video, the user will try to guess your favourite video game. They will continue guessing until they guess correctly.

~ CODE ~

game = "Minecraft"
guess = input("Guess what my favourite video game is: ")

while guess != game:
guess = input("Incorrect - try again! \n \nGuess what my favourite video game is: ")

print("Congratulations - you guessed my favourite video game!")
Рекомендации по теме
Комментарии
Автор

When he said his fav game was minecraft i was hooked with this tutorial

tila
Автор

Making a video tutorial is like writing an email trying to get a message across, it's a skill. If someone knows how to express their thoughts and put them in the email in a cohesive way, the message will be understood, otherwise it will be misinterpreted. Congratulations!

aprosimracing
Автор

Hi I was making python code and I was wondering could I use more than one favourite game because I tried to do so and it didn't work out. I used "and" and "or" statements but, as I have stated, it didn't work.

bsed