Write a program to write a string in a file


Topic: Write a program to write a string in a file

Solution

filename = 'file1.txt'
string = "programming in \n python"
f1 = open(filename,'w')
f1.write(string)
f1.close()



List all Python Programs