Class 7 – Wednesday, April 12
Make Bill Murray proud
Take another step — Chrestomathics awaits you — Feel the momentum
Look both ways
Comments about Homework 05
- The program was supposed to get a single integer as input. To try different values the program gets run different times.
- Use spaces to make operators stand out.
- Do not use
input()unless you want a reply from the user. Use
print()to display the result of a computation
- In Python, variables are as a rule always lowercase and if they are composed of multiple words they are in snake_case.
- When better variable names are available use them; some examples that could be improved
nare not good names for ages.
agefakeis not a good Python variable name -- it should be in snake_case; i.e.,
age_fakeor even better
AgeNotis not a good Python variable name -- it should be in lowercase snake_case; i.e.,
Faux_ageis not a good Python variable name -- it should be in lowercase snake_case; i.e.,
Supposed_ageis not a good Python variable name -- it should be in lowercase snake_case; i.e.,
- Continue exploration of the basics of problem solving — getting data, performing computation, and displaying information. Along the way we will develop an appreciation:
- General expression evaluation and formulation
- Relational evaluation and composition
- Input acquisition
Examples (today you should left-click rather than right-click)
- math_illiteracy.py – some math and math-like demonstrations
- temperature.py – another expression evaluation nuance
- can_you_relate.py – introduces the comparison operators
- logical_operators.py – introduces the logical operators
- break_the_bank.py – practice problem solving
To do list
- Review class artifacts
- Read about the Python
- Read about Python built-in functions
- Read about Python string capabilities.
- Read problem-solving epistle