Answers for "arithmetic operators in python"

5

python math operators

# Below follow the math operators that can be used in python
# ** Exponent	
2 ** 3 # Output: 8
# % Modulus/Remaider	
22 % 8 # Output: 6
# // Integer division	
22 // 8 # Output: 2
# / Division	
22 / 8 # Output: 2.75
# * Multiplication	
3 * 3 # Output: 9
# - Subtraction	
5 - 2 # Output: 3
# + Addition	
2 + 2 # Output: 4
Posted by: Guest on February-21-2020
1

python comparison operators

# Below follow the comparison operators that can be used in python
# == Equal to
42 == 42 # Output: True
# != Not equal to
'dog' != 'cat' # Output: True
# < Less than
45 < 42 # Output: False
# > Greater Than
45 > 42 # Output: True
# <= Less than or Equal to
40 <= 40 # Output: True
# >= Greater than or Equal to
39 >= 40 # Output: False
Posted by: Guest on February-21-2020
5

python logical operators

not 
and 
or
Posted by: Guest on November-01-2020
0

arithmetic in python

print(10 + 2) # Addition
print(10 - 2) # Subtraction
print(10 * 2) # Multiplication
print(10 / 2) # Division
print(10 % 3) # Modulus
print(10 // 2) # Floor Division
print(10 ** 2) # Exponent
Posted by: Guest on September-28-2021
0

arithmetic operators in python

Arithmetic operators: Arithmetic operators are used to perform mathematical 
  operations like addition, subtraction, multiplication and division.
Posted by: Guest on November-26-2020

Code answers related to "arithmetic operators in python"

Python Answers by Framework

Browse Popular Code Answers by Language