Class 12 : File Handling Set 4

6.
Write a program to count and display the occurence of word ‘why’ in the file.

7.
Write a program to count the words starting with vowel.

8.
Write a program to display the longest line of the file.

9.
What will be the output of the following code?

fh=file("poem.txt","r")
	size=len(fh.read())
	print(fh.read(5))
	fh.close()

10.
What will be the output of the following code?

fh=open("poem.txt","r")
	s1=fh.read(28)
	print(s1)
	fh.close()