The conversion quiz is in canvas. If you want to show work, you have the option of submitting on paper. Please put your NAME on the paper if you elect to do this!
Last Time
Python Scalar Types We have met the basic scalar (non-collection) types in Python. Here is the scheme.
- Numeric types
int
, arbitrary-precision integersfloat
, IEEE 754 double-precision (64 bitt) floating point numberscomplex
, complex numbers
bool
, the boolean type. It has two objects,True
anFalse
.str
, the sring type. This stores globs of text. Literals can be enclosed in single or double quotes.
Python Scalar Types | ||
---|---|---|
Type | State | Behavior |
int
|
the integer value being stored | Integers respond to arithmetic operators using the Wormwoodean order of operations. |
float | the floating-point value being stored | Floats respond to arithmetic operators using the Wormwoodean order of operations. |
complex | the complex value value being stored | Complex numbers respond to arithmetic operators using the Wormwoodean order of operations. |
bool |
True or False . |
These respond to the boolean operators
not , and , and or . |
str |
The character sequence within the string | These respond + (concatenation), *(int) (repetition), an
have methods such as upper() and
lower() . |
All Python scalar types are immutible; once created their state is not changeable. We will see how this makes sense when we discuss variables.
Variables
What is a memory address?
Two kinds of memory
What do variables actually store?
Assignmennt
Symbol Tables.
Variables are typeless names.