Computer Science, asked by srivastavaaaryanshi, 7 months ago


Write a function in python to read a text file and print alternate lines of the
file starting from first line.​

Answers

Answered by akshita7566
1

Answer:

Being a great general purpose programming language, Python has a number of very useful file IO functionality in its standard library of built-in functions and modules. The built-in open() function is what you use to open a file object for either reading or writing purposes.

fp = open('path/to/file.txt', 'r')

The open() function takes in multiple arguments. We will be focusing on the first two, with the first being a positional string parameter representing the path to the file that 

Similar questions