Class 03 – Monday January 24
Naming Names: Beginning Variable Assignment
Some Haikus
Together we learn — To say what we mean to say — Most valuable skill
What makes me happy — Students asking their questions — So please keep it up.
Look both ways
Quote of the day
- So early in my life, I had learned that if you want something, you better make some noise. — Malcom X
First Example of the Day
- Program camouflage_not_needed.py
What is happening today
- Continue our exploration of digital problem solving
- We will do this every class this semester
- Expand our communication and abstraction skills
- Readability and consistency
- Ideas and plans are only good if they can be easily understood.
- Must appreciate and strive for writing readable code
- Practice debugging
- Pay mindful attention to what our solutions actually say to do.
- Recognize naming allows us to interact with the world around us.
- Ability to name values is part of the essence of being human.
- Ability to name values is a cornerstone of programming. Variables will be the means to do so.
- Introduce how Python supports integer, decimal, and string values, and their manipulation.
- Introduce additional terminology to which you should become accustomed
Typical during class activities
- Learn
- Try
- Ask questions
- Make suggestions
- Provide answers
Typical post-class activities
- Read
- Examine class examples
- Learn
- Try
- Write down questions
- Complete the homework
Homework 03 Now Due Tuesday
- Complete the homework
- Make sure to follow all the instructions very carefully.
Vocabulary to which you should become accustomed
- A lexicon when participating in computing-related structured communication
|
|
|
|
Upcoming example - Debugging
- Program piaget.py
- Typos galore
- Code listing
Purpose: correct errant code
Author: Elizabeth Orrico
Id: emo7bf
print( "We learn best, when we must invent. -- Jean Piaget'
print( 'Necessity breeds invention.")
- Program xy.py
- Introduces naming and assignment operator
- Program xyx.py
- Introduces updated assignment
Python arithmetic
- The Python arithmetic operators are: addition:
+
; subtraction:-
; multiplication:*
; decimal division:/
; integer division://
; exponentiation:**
; remaindering:%
- If one of the operands of an arithmetic operation is decimal, the result is decimal; otherwise, the result is integer except for decimal division.
Identifiers and Keywords
- An identifier is a sequence of characters such that the first character is alphabetic and the remaining characters (if any) are alphabetic or numeric
- Python considers the underscore character (
_
) as alphabetic.
- Keywords are words reserved by Python for special usage; as such, they cannot be used to name things.
- For example, keyword
import
tells Python the contents of module (library) is to be included as a program resource.
To do list
- Review class artifacts
- Complete the homework due by Midnight Tuesday.
🦆 © 2022 Jim Cohoon | Resources from previous semesters are available. |