- This event has passed.
5pm Intro To Python – Bill
October 20, 2021 @ 5:00 pm - 6:00 pm
Today We:
- Continued the Hangman Project
- Made it so when you guess wrong, you lose a life
- Made the life bar update and show the correct number of lives you have
- Made it so you lose when you run out of lives and ends the game
- Started to review looping through lists and index’s to better understand how to make the guessing list of letters show what the player has guessed
Your HW:
- Create a list of integers: [-2,-5,10,20,100]
- Continuously ask user “Enter an integer: “
- Get the integer input from the shell (Hint: all input from shell comes in as a String)
- Loop through the list of integers and check for if the input is in the list
- If it is, print out “<number> is inside the list
with index <index>”
- If it is, print out “<number> is inside the list
- Expected result:
Enter a number: 0 Enter a number:10 10 is inside the list with index 2 Enter a number: -2 -2 is inside the list with index 0
- Create a list of movies [“Shrek”,”Transformers”, “The Bee Movie”]
- Ask the user for their favorite movie
- Loop throught hte list of movies and check if that movie is in the list
- If it is, print out “<Movie> is inside the list
with index <index>” - Expected result
Enter a movie: Mario Enter a movie: Shrek Shrek is inside the list with index 0