Quickpaste.it
Create Paste
Top Pastes
Recent Pastes
Settings
Account
Untitled Paste
Created By
Anonymous
Expires never
Raw
Download
0
# open file in read mode fn = open('file.txt', 'r') # open other file in write mode fn1 = open('nfile.txt', 'w') # read the content of the file line by line cont = fn.readlines() print(cont) type(cont) for i in range(0, len(cont)): if(i%2 == 0): #index starting zero so first odd line start at 0th place fn1.write(cont[i]) else: pass fn1.close() # open file in read mode fn1 = open('nfile.txt', 'r') # read the content of the file cont1 = fn1.read() # print the content of the file print(cont1) fn.close() fn1.close() INPUT: file.txt – contai