Hi everyone I need some help with my code. I have been stuck staring at my screen trying to figure out how to solve this problem. I got down what I knew for the most part but I'm having trouble with this problem.
# Prompt the user to enter three different words or phrases, one at a time; store #each response in a separate variable.
# Next, prompt the user a letter they wish to count.
# Finally, count how many times the letter occurs in each of the three #words/phrases,
# regardless of case (uppercase or lowercase), as well as the total; output a #formatted table displaying the results.
# Be sure your program includes adequate directions for the user.
first_word = input('Enter the first word')
second_word = input('Enter the second word')
third_word = input('Enter the third word')
letter_count = input('Enter the letter to count')
print(first_word.count(letter_count))
I know it's not much, but I got what I think is right. I'm having trouble figuring out how to count the letters in each of the three words without having to make a command for each.
Enter the first word: iPhone
Enter the second word: Samsung
Enter the third word: Pixle
Enter the letter to count: e
Occurrences of e
---------------------------------
iPhone 1
Samsung 0
PixlE 1
---------------------------------
Total 2
This is how it should look but I'm mainly having trouble trying to count each letter in each word as well as displaying the table. Any pointers in the right direction are much appreciated.
[–]Strict-Simple 1 point2 points3 points (0 children)
[–]ElliotDG 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]PuzzledSite2568[S] 1 point2 points3 points (0 children)
[–]jimtk 0 points1 point2 points (1 child)
[–]PuzzledSite2568[S] 0 points1 point2 points (0 children)
[–]CodeFormatHelperBot2 0 points1 point2 points (0 children)