« All Events
2 PM – Intro To Python – Gamas
August 21, 2021 @ 2:00 pm - 3:00 pm
Today We Do
- We finished Magic 8 Ball version 1 using random.randint
- We finished Magic 8 Ball version 2 using random.choice
- We started HangMan game.
Homework
- Continued with the HangMan game. Create a forever loop that will continuously doing the following
- Print the 9 hearts symbols
- Ask input from Shell “Guess a letter or the whole word: “
- Add an if statement that would check if the user input is equal to secret_word variable. If they are the same, break from the loop and print “Congratulation, you won the game”.
- It should look like this
-
>>> %Run Aug21_HangmanGame.py
ogre
❤❤❤❤❤❤❤❤❤
Guess a letter or the whole word: a
❤❤❤❤❤❤❤❤❤
Guess a letter or the whole word: d
❤❤❤❤❤❤❤❤❤
Guess a letter or the whole word: dragon
❤❤❤❤❤❤❤❤❤
Guess a letter or the whole word: ogre
Congratulation you have won the game.
>>>