Computer Science, asked by raaghavnaidu1595, 21 days ago

F = open("Rhymes.txt") S = F.read() print(S.count('e',20))

Answers

Answered by harsh5599
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