Summary

Python

We introduced some basic statements and structures in the Python programming language. Let’s quickly review them!

The print(expression) statement is used to print output on the terminal.

  1. It will evaluate expression to a value, then display it to the screen.
  2. By default, it will add a newline to the end of the output.
  3. We can change that using the end parameter, such as print(expression, end="") to remove the newline.

Assignment Statement

The assignment statement, like a = expression is used to create variables and store values in the variables.

  1. The variable must be on the left side, and the right side must be an expression that evaluates to a single value.
  2. If the variable does not exist, it is created. Otherwise, the current value of the variable is replaced by the new value.
  3. Variable names must begin with a letter or underscore, and may only contain letters, numbers, and underscores.
  4. Variable names beginning with an underscore have a special meaning, so we won’t use them right now.