'''
Assignment No: 16
To copy contents of one file to other. While copying a) all full stops are to be
replaced with commas b) lower case are to be replaced with upper case c) upper case
are to be replaced with lower case.
'''
try:
fin = open("input.txt",'r') # file opening in read mode
fout = open("output.txt",'w') # file is created
for line in fin:
line = line.swapcase() #Replace lower case with upper and upper with lower
line = line.replace(".","*") #Replace full stops with *
fout.write(line)
except:
print("File error occured")
Assignment No: 16
To copy contents of one file to other. While copying a) all full stops are to be
replaced with commas b) lower case are to be replaced with upper case c) upper case
are to be replaced with lower case.
'''
try:
fin = open("input.txt",'r') # file opening in read mode
fout = open("output.txt",'w') # file is created
for line in fin:
line = line.swapcase() #Replace lower case with upper and upper with lower
line = line.replace(".","*") #Replace full stops with *
fout.write(line)
except:
print("File error occured")
Nice and easy practical
ReplyDeleteThanks
Delete👍
ReplyDeleteThanks Snehal
DeleteVery nice program and easy to understand
ReplyDeleteThanks
DeleteEasy to understand and explain easily in practical session
ReplyDeleteThanks
DeleteEasy to understand
ReplyDeleteThanks
DeleteInterested
ReplyDeleteThanks
DeleteNice
ReplyDeleteThanks Vaishnavi
DeleteInterested ☺
ReplyDeleteThanks Pallavi
DeleteEnjoyable
ReplyDeleteGreat program
ReplyDeleteThanks
DeleteThis comment has been removed by the author.
ReplyDeleteEasy to Understand...
ReplyDeleteThanks Aboli
DeleteThanks
DeleteEasy to understanding
ReplyDeletethank you pratiksha
DeleteEasy to understanding
ReplyDeleteThanks
DeleteEasy
ReplyDeleteThanks
Delete🚩 सोपे आहे प्रात्यकशिक 🚩
ReplyDeleteThanks
Delete:)
Delete🎌 nice🎌
ReplyDeleteThanks
DeleteI know where this file operation is used
ReplyDeleteEasy to understand
ReplyDeleteThanks
DeleteEasy to understand
ReplyDeleteThanks
DeleteEasy to understand
ReplyDeleteThanks Bhushan
DeleteConcept are clear
ReplyDeleteThanks
DeleteThanks
ReplyDeleteVery easy
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteEasy to understand
ReplyDeleteEasy to understand
ReplyDeleteEasy to understand
ReplyDeleteEasy to understanding 👍👍
ReplyDeleteUnderstood
ReplyDeleteProgram is showing indentation error in line 2
ReplyDeleteUnderstand
ReplyDeleteEasy to understand
ReplyDelete