Lesson 23. Capstone project: analyze your friends
After reading lesson 23, you’ll be able to
- Write a function to read a file line by line
- Save numbers and strings from the file in variables
- Write a function to analyze the stored information
The only two ways you’ve seen so far to input data are to (1) to predefine variables in your program or (2) to ask the user to input data one-by-one. But when users have a lot of information to input into your program, you can’t expect them to enter it in real time. It’s often useful to have them give you the information in a file.
Computers are great at doing many computations quickly. A natural use for computers is to write programs that can read in large amounts of data from files and to perform simple ...
Get Get Programming now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.