ShriRam Changed status to publish August 21, 2023
try:
# Open a file
fo = open(“foo.txt”, “w”)
fo.write(“Python is a great language.\nYeah its great!!\n”)
except IOError:
print (“Error: can\’t find file or read data”)
else:
print (“Written content in the file successfully”)
# Close opend file
fo.close()
ShriRam Changed status to publish August 21, 2023