Intro to Python for Computer Science and Data Science: Learning to Program with AI, Big Data and The Cloud
by Paul J. Deitel, Harvey M. Deitel
Exercises
9.1 (Class Average: Writing Grades to a Plain Text File) Figure 3.2 presented a class-average script in which you could enter any number of grades followed by a sentinel value, then calculate the class average. Another approach would be to read the grades from a file. In an IPython session, write code that enables you to store any number of grades into a
grades.txtplain text file.9.2 (Class Average: Reading Grades from a Plain Text File) In an IPython session, write code that reads the grades from the
grades.txtfile you created in the previous exercise. Display the individual grades and their total, count and average.9.3 (Class Average: Writing Student Records to a CSV File) An instructor teaches a class in which each student ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access