Chapter 2 - Main Ideas
- Lines starting with
#are called "comments" and Python skips them.- Like blank lines, comments help people understand code easier.
- Functions can take "arguments".
- Example:
player.move_forward(5) - Example:
player.collect("water")
- Example:
- Variables can be used to store values. They have different types.
- Integer variable example:
score = 5 - String variable example:
message = "hello"
- Integer variable example:
- Variables can be passed as arguments to functions.
- Example:
player.place(wheat)
- Example: