1. There are two types of loops in Python: while
and for
:
Conditionals
1. The comparison (otherwise known as relational) operators are used to compare values. The table below illustrates how the comparison operators work, assuming that x = 0
, y = 1
, and z = 0
:
Input() function
1. The print()
function sends data to the console, while the input()
function gets data from the console.
Variables
1. A variable is a named location reserved to store values in the memory. A variable is created or initialized automatically when you assign a value to it for the first time. (2.1.4.1)
Comments
1. Comments can be used to leave additional information in code. They are omitted at runtime. The information left in source code is addressed to human readers. In Python, a comment is a piece of text that begins with #
. The comment extends to the end of line.