« All Events
6 PM – Intro To Python – David
February 19, 2022 @ 6:00 pm - 7:00 pm
Today We Do
- We continued with Feb12_Hangman.py
- We added question marks to give clue how many letters inside the secret_word.
- We display health symbols according to the number of health we have.
Homework
- Continue on Feb12_Hangman.py.
- Change the code inside the while loop, so when user enter the entire word and the word exactly match the secret_word, break from the loop.
- By the way, you guys can change the symbol of your health by going here and choosing the unicode https://materialui.co/unicode-characters/
- Change the code so every time it loops, it will print 3 things, the question marks, the health symbols and the “Enter a letter or the entire word:” look at below
-
['?', '?', '?', '?', '?', '?', '?']
❤️❤️❤️❤️❤️❤️❤️❤️❤️
Enter a letter or the entire word: asdf
['?', '?', '?', '?', '?', '?', '?']
❤️❤️❤️❤️❤️❤️❤️❤️
Enter a letter or the entire word: adf
['?', '?', '?', '?', '?', '?', '?']
❤️❤️❤️❤️❤️❤️❤️
Enter a letter or the entire word: s
['?', '?', '?', '?', '?', '?', '?']
❤️❤️❤️❤️❤️❤️
Enter a letter or the entire word: