



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Today
Reading
Homework
Programs often take input from a file
A simple echo program
When this runs ...
Close files when done with them
the_file = open(’test.txt’) ... do stuff ... the_file.close()
Each line is considered a string
10 20 30 40 50 60
the_file = open("nums.txt") for line in the_file: num = int(line) print(num)