CS 110A Lecture Notes - Simple Python Data - Chapter 2

Chapter 2 of How to Think Like a Computer Scientist

Making You Own Notes for Useful Commands

Data Types and Variables

Some of the most common data types:

Calculations and Assignments

Programming Style

calcDemo.py: Here is an example demonstrating how variables and data types work in calculations, and with simple input.

In-class exercise: Write a program to calculate and output the average of three test grades input by the user. Here is some sample output:

Please enter the first test score 90
Please enter the second test score 81.2
Please enter the third test score 88.77
The average grade is 86.65666666666665