Page 94 - Touchcode_C7_Flipbook
P. 94
Multiple-line Comment
Python does not have a syntax for multiline comments. To add a multiple line comment,
you could insert a # for each line.
However, the text written inside triple quotes (‘ ’ ’ or ‘’ ” ”) is also considered as comment. You
can use the triple quotes to write multiline comments.
OPERATORS
Python divides the operators in the following categories.
Arithmetic Operators
Arithmetic operators perform arithmetic operations between two operands. The arithmetic
operators are defined in the following table:
Operator Name Description Example Output
(x=7 and
y=3)
+ Addition Adds values on either side of the x + y 10
operator.
– Subtraction Subtracts right hand operand x – y 4
from left hand operand.
* Multiplication Multiplies values on either side of x * y 21
the operator.
/ Division Divides left hand operand by right x / y 3
hand operand.
% Modulus Divides left hand operand by x % y 1
right hand operand and returns
remainder.
** Exponentiation Performs exponential (power) x ** y 343
calculation on operands.
// Floor or Integer Divides and cuts the fractional x // y 2
division part from the result.
Touchcode-VII
92 Touchcode-VII
92

