0
def show_hidden_word(secret_word, old_letters_guessed):
i = 0
new_string = ""
while i < len(secret_word):
    j = 0
    print(1)
    for j in old_letters_guessed:
        if secret_word[i] == old_letters_guessed[j]:
            new_string += secret_word[i]
        print(old_letters_guessed[j])
        j += 1
    print(secret_word[i])
    i += 1
return new_string

Why the comparate between those string don't work?And can someone help to fix it?

2 Answers2

0

This should help. You can convert the input to int or 9 to string '9'

choice = input('Enter an option - out of the loop')
while int(choice) != 9:  #or while choice != '9'
    menu(list_of_products, choice)
    choice = input('Enter an option - in the loop')
Rakesh
  • 81,458
  • 17
  • 76
  • 113
-1

Maybe choice is a string and you need to convert it to int.

rbs
  • 169
  • 4
  • 10