Thursday, 28 November 2019
Monday, 25 November 2019
Thursday, 14 November 2019
Thursday, 7 November 2019
Friday, 11 October 2019
Saturday, 3 August 2019
Assignment No: 16 Character Conversion UPPER to lower and lower to UPPER case
'''
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")
Subscribe to:
Posts (Atom)
Microsoft’s latest Surface Pro X is now available in India
Microsoft Surface Pro X 2020 is now available in India at a starting price of Rs 1,49,999. Here's everything you would like to unders...
-
''' Assignment No: 1 To calculate salary of an employee given his basic pay (take as input from user). Calculate gross salar...
-
''' Assignment No: 2 To accept an object mass in kilograms and velocity in meters per second and display its momentum. Momen...
-
''' Assignment No:3 To accept N numbers from user. Compute and display maximum in list, minimum in list, sum and average of ...




