File handling
Aim: Implement
a Program to implement the concept of files
Algorithm:
1.Start
2.Open a file in write mode
3.Save some data.
4.Display the content
in the file
6.Stop
Program:
colors = ['red\n', 'yellow\n', 'blue\n']
f = open('colors.txt',
'w')
f.writelines(colors)
f.close()
Output:
Red
Yellow
blue
0 Comments:
Post a Comment