Computer Science, asked by shaileshkumar4962, 9 months ago

Write a program in python of read a file say “story.txt” and print the

lines which end with letter ‘r’.​

Answers

Answered by gyaneshwarsingh882
0

Answer:

Explanation:

Opening a File

First we will need a string to specify the name of our file.

We could have a variable for this and could:

Say it literally, if your program is always going to use the same name.

Read it from the user using input() and save it in a variable

Note: avoid using 'file' as a variable name, because it is a type.

Next, we use the command open and the name of the file

Similar questions