Introduction to Python¶
This module introduces the Python vocabulary students need before writing games and robot-control code.
Learning Goals¶
- Use variables to store values.
- Distinguish common data types such as integers, floats, booleans, strings, lists, tuples, and dictionaries.
- Run expressions in the Python interpreter.
- Understand that variables reference values in memory.
- Read simple
if,while, andforstructures.
Suggested Flow¶
- Open a terminal and run the Python interpreter with
python3. - Try arithmetic and string expressions.
- Assign values to variables and inspect them.
- Use
type(...)to compare values. - Move from the interpreter into a
.pyfile in VS Code.
Student Checks¶
Ask students to predict each result before running it:
x = 10
y = 10.0
name = "robot"
ready = True
print(type(x))
print(type(y))
print(name + " arm")
print(not ready)
Materials¶
Connection to Robotics¶
Robot programs use the same small building blocks as beginner games: values, choices, repetition, and named helper functions. The difference is that the output eventually becomes physical motion instead of text on the screen.