Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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
Comment

arithmetic operators in python

a = 90
b = 20
#additaddition 
print(a+b)
#subtraction
print(a-b)
#multiplication
print(a*b)
#divison
print(a/b)
#Exponentiation
print(a**b)
#floor divison
print(a//b)
Comment

why a Python Arithmetic Operators used

#Arithmetic operators are used with numeric values to perform common 
#mathematical operations:
Comment

arithmetic operators in python

# Examples of Arithmetic Operator
a = 9
b = 4
 
# Addition of numbers
add = a + b
 
# Subtraction of numbers
sub = a - b
 
# Multiplication of number
mul = a * b
 
# Division(float) of number
div1 = a / b
 
# Division(floor) of number
div2 = a // b
 
# Modulo of both number
mod = a % b
 
# Power
p = a ** b
 
# print results
print(add)
print(sub)
print(mul)
print(div1)
print(div2)
print(mod)
print(p)
Comment

arithmetic operators in python

Arithmetic operators: Arithmetic operators are used to perform mathematical 
  operations like addition, subtraction, multiplication and division.
Comment

PREVIOUS NEXT
Code Example
Python :: python how to get last element in a list 
Python :: iterate a list of tuples 
Python :: how to filter queryset with foreign key in django 
Python :: form action in django 
Python :: python constant 
Python :: django pagination class based views 
Python :: map python 3 
Python :: data where values in column starts with particular value 
Python :: how to get table schema sql pyodbc 
Python :: python flask api 
Python :: numpy one hot 
Python :: test with python 
Python :: sqlalchemy convert row to dict 
Python :: browser = webdriver.firefox() error 
Python :: python line break inside string 
Python :: Python not readable file 
Python :: iterating index array python 
Python :: send serial commands in python 
Python :: Group based sort pandas 
Python :: delete and start fresh with db django 
Python :: url_for 
Python :: django admin.py 
Python :: power of array 
Python :: pandas df describe() 
Python :: axios django csrf 
Python :: python code to get wifi 
Python :: Change Python interpreter in pycharm 
Python :: serializer phonenumber field json 
Python :: python threading return value 
Python :: python get number of arguments of a function 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =