Suppose we have a file songs.txt that contains a single line: Space Oddity. We have implemented the following code:
f = open('songs.txt', 'w', encoding='utf-8')
f.write('Life on Mars')
f.close()
What will be the contents of songs.txt after this?
Suppose we have a file songs.txt that contains a single line: Space Oddity. We have implemented the following code:
f = open('songs.txt', 'w', encoding='utf-8')
f.write('Life on Mars')
f.close()
What will be the contents of songs.txt after this?
Create a free account to access the full topic