Is there a way to figure out characters in a string? This is just an example of a very simple game that I quickly made, but I can't figure out how to tell the computer to read the string for letters. Is there a certain function or such that will do this? Basically, I'm trying to create a way to figure out if the user input matches the correct character of the random string.
import random
word = ['Friend', 'Foe', 'Enchilada', 'Bamboozled', 'Smuggled', 'Flabbergasted']
YOOO = random.choice(word)
UndCrs = ' _ ' * len(YOOO)
print(UndCrs)
while True:
guess = input('Guess a random word in the alphabet')
if guess not in 'abcdefghijklmnopqrstuvwxyz':
print('Only characters please')
# Rest of character string code
...
break
My code currently is somewhat correct. With a bit of tweaking, I can fix the rest, just need help on this. Sorry for no formatting. It's late.