American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

1 PM – Intro To Python

August 8, 2020 @ 1:00 pm - 2:00 pm

  1. We continued with Hangman game.
    1. We learned how to loop through each element in the list via for loop using the list index.
    2. We learned how to treat string as list.
    3. We learned how to replace question mark inside the list with the user guessed letter.
  2. Homework:
    1. In the hangman game, when the user guess a letter correctly, you need to update the question mark (“?”) with the right letter. For example,
      1. ['?','?','?']
        
        if the secret_word is "cat" and user enters "a" then you need to update "?" in the middle to be "a" like the following
        
        ['?','a','?']
      2. In order to do this, you need to need to review what we did in Aug8_LoopingListForLoop.py. You need to put your code inside the function “update_clue(user_guessed_letter)”. This is the function that we did in the class. Last time in the class, we did the following and you need to modify this function to replace the “?” from “clue” variable. Again you need to review what we did last week in “Aug8_LoopingListForLoop.py” file:
        1. def update_clue(user_guessed_letter):
              # You need to update the clue variable
              pass

Details

Date:
August 8, 2020
Time:
1:00 pm - 2:00 pm
Event Categories:
,