-
Assign a letter to a variable to serve as the secret
answer -
Ask the user to enter a
letter, assign it to a variable -
ifthe user'sletteris the same as theanswer, inform the user they've guessed correctly. Otherwise, inform them they've erred and display the correct answer.
-
Ask the user for a
word -
Ask the user for a
letter -
Assign the
wordand theletterto variables -
Use the keyword
into determine if theletterisintheword -
Tell the user
iftheletterisintheword. Display the letter in uppercaseEnter a word: umbrella Enter a letter: b output: The word "umbrella" contains the letter "B". ------------------- Enter a word: umbrella Enter a letter: z output: The word "umbrella" does not contain the letter "Z".
If the word contains the letter, tell the user how many times the letter is in the word
Enter a word: giraffe
Enter a letter: f
output:
The word "giraffe" contains the letter "F" 2 times.
Using string methods, determine if the string the user entered contains only letters, no spaces, numbers or special characters.
if the string contains characters other than letters, inform the user that those characters aren't allowed.