For loop in Python

Posted on: January 18th, 2023
By: Tadeo Martinez

letter in the for loop will go through each of the letters in the string

random_word = "random word"

for letter in random_word:
  # print(letter)
  if letter == guessed_letter:
    print("Correct")
  else:
    print("Wrong")

Have any questions or comments? Write them below!


Leave a Reply

Your email address will not be published. Required fields are marked *