Page 134 - Computer_Genius_v2.1_C7_flipbook
P. 134
Arithmetic Operations
Arithmetic Operations are used in python for performing mathematical operations on variables and
values. Python has 7 Arithmetic Operations.
Data type identifies what the type of data that the declared variable can hold.
Operator Block Based Meaning Example
+
Add two operands or unary plus x + y
(Addition)
- Subtract right operand from the left or
x - y
(Subtraction) unary minus
*
Multiply two operands x * y
(Multiplication)
/ Divide left operand by the right one
x / y
(Division) (always results into float)
% Remainder of the division of left operand
x % y
(Modulus) by the right (remainder of x/y)
** A type of Multiplication where a value is
(Exponentiation/ multiplied with itself for a certain number x ** y
Power Operator) of times
Switch to Textual Coding
To switch to textual code in AI Connect, follow the given steps:
1 Click on the Switch View slider placed at
top-right hand side of AI Connect window.
2 Type the code in
right window using a
keyboard.
132 Computer Genius (V2.1)-VII

