File Handling
File Handling
Write a script that will read the file 'twasthenight.txt'
and print each line of the poem to the screen.
Then, print out the amount of lines in the file.
f = open("twasthenight.txt","r")
number_of_lines = 0
for line in f:
print(line)
number_of_lines = number_of_lines + 1
print("This file has : " + str(number_of_lines) + " lines")
Write a script to create a new file and
print the chorus of "We wish you a Merry Christmas"
hint you will need to do some research on file
handling for this and output.
go through the file and output the file
say how many lines are in the file