F = open("Rhymes.txt") S = F.read() print(S.count('e',20))
Answers
Answered by
0
File :-
Twinkle twinkle little starts,
How i wonder what you are,
Up above the world so high,
Like a diamond in the sky
Input :-
F = open("Rhymes.txt")
S = F.read()
print(S.count('e', 20)
Output :-
7
Explaination :-
1) We are opening the python file in read mode.
2) We are reading the file using .read().
3) We are counting the letter 'e' after the first 20 characters.
Similar questions