Text File Operations
[Link] a Python function that displays all the words starting
and ending with a vowel from a text file "[Link]". The
consecutive words should be separated by a space in the
output.
For example, if the file contains :
Once there was a wise man in a village.
He was an awesome story-teller.
He was able to keep people anchored while listening to him.
Then the output should be :
Once a a awesome able
[Link] a Python function that displays all the lines ending with a
dot (.) from a text file "[Link]". For example, if the file contains
:
White is a mix of seven colors.
What are these seven colors ?
VIBGYOR – violet, indigo, blue, green, orange and red.
When we mix all these colors we just get one light
which is the WHITE light.
Then the output should be :
White is a mix of seven colors.
VIBGYOR – violet, indigo, blue, green, orange and red.
which is the WHITE light.
3. Write a function in Python to display the line which has the
maximum number of vowels from a text file, "[Link]".
[Link] a Python function that finds and displays all the
words longer than 5 characters from a text file "[Link]".
[Link] a Method with name Display() in Python which
display those lines which either start with letter “K” or Letter
“R”.
[Link] a user defined function in Python named
showInLines() which reads contents of a text file named
[Link] and displays every sentence in a separate line.
Assume that a sentence ends with a full stop (.), a question
mark (?), or an exclamation mark (!).For example, if the content of
file [Link] is as follows:
Our parents told us that we must eat vegetables to be healthy. And it
turns out, our parents were right! So, what else did our parents tell?
Then the function should display the file's content as follows:
Our parents told us that we must eat vegetables to be healthy.
And it turns out, our parents were right!
So, what else did our parents tell?