Before Class
- Read Simple Python Data from the beginning through the section entitled Variable Names and Keywords.
Class Activity
- Give an example of the string (str) type.
Now give an example of the integer (int) type.
Finally, give an example of the float type.
- Why do we care about types?
- How can you print the sentence "She's from Cuba" if you want
all of the quote marks to show up?
- Explain the difference between print("hi", "there")
and print("hi" + "there")?
- How can you convert 3.14 into a string? Into an integer? Into a float?
- Give an example where using a variable in a Python program is helpful.
- Explain how the assignment operator, =, works.
- Why might it a good idea to only use lower case letters in
variable names?
- Why is it a good idea to make variable names meaningful?
- Give an example of an illegal variable name.
Active Learning Activity
Work the following exercises.
- Exercise 1.
- Exercise 2.
- Exercise 3.