Variables and Statements
Learning Goals
Preparation for class:
- Look over this Google Sheet on Binary Numbers. I will explain it in class or will do a video explanation before class if I have time.
- Review Think Python Chapter 1 Programming as a Way of Thinking from last week.
- Read Chapter 2 Python Crash Course, Variables and Simple Data Types
- The primary goal for this class will be practicing coding. A lot. I will introduce some "beginner" coding examples that may not be covered in the readings, just to prime you for the complexity that will be coming very soon.
- Review the highlighted Computer Basics file I posted in Canvas.
Python Interpreter
We did a little bit of a demo with the interpreter last week. We will demo it some more, but we will mostly practice in Visual Studio Code in this session.
We will spend a lot more time with the Basics Code Samples in the site sidebar, and try to code up unique and personal micro-programs.
# Items we will do on Command Line Interface (CLI)
mac: open an terminal if you are on a mac and enter python3
Windows: open Python app and you will be ready to go
>>>
Pseudocode: informal language that is not meant to be compiled or executed
print hello world!
enter 8 + 4 to use the interpreter as a calculator
enter 8 / 0 to intentionally make an error
enter 8 / 3 to get a decimal number (float)
enter 5 // 2 to get a truncated remainder
enter: help() ----> will put you in help> utility
enter: keywords
enter: quit to leave help
enter help('keywords') for quick help on a topic and stay out of help> utility
help(keywords) will throw an error if you leave out quotation marks