This is my first computer related class EVER. We're on week 2, chapter 2 and I need to:
"Write a program whose input is a string which contains a character and a phrase and whose output indicates the number of times the character appears in the phrase."
Really simple, right? Well, i can't for the life of me figure out what is wrong with my program. I've separated out the part I think is the problem:
user_string = input()
user_character = user_string[0][0]
times = user_string.count('user_character') # problem line #
print(user_string)
print(user_character)
print(times)
input:
t Just trying to find all the ts.
expected output:
t Just trying to find all the ts.
t
5
actual output:
t Just trying to find all the ts.
t
0 <<< Why 0?