File operation for copying content of one file to another without for loop

#  Implementation without for loop
#  Copying content of 1.txt file to 2.txt after creation of file
#  Please provide the 1.txt file in the current folder as input and
#  check after runing the program in the same folder for 2.txt

I=open('1.txt',"r")
O=open('2.txt',"w")
C=I.readlines()
O.writelines(C)
I.close()
O.close()

2 comments:

SATHYA TECH said...

thanks for providing your valuable post
best regards
python training in hyderabad
python training institutes in hyderabad
best python training centers in hyderabad

vinito deepak said...

I wondered upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.
PHP training in chennai