Saturday, 6 January 2018

Python Arithmetic Operators

#!/usr/bin/python3
a = int(input("Enter the value for a"))
b = int(input("Enter the value for b"))
c = 0
c = a + b
print ("Sum of a and b is ", c)
c = a - b
print ("Substraction of a and b is ", c )
c = a * b
print ("Multiplication of a and b is ", c)
c = a / b
print ("Division of a and b is ", c )
c = a % b
print ("Modulus of a and b is ", c)
c = a**b
print ("Exponent of a and b is ", c)
c = a//b
print ("Floor Division of a and b is ", c)


No comments:

Post a Comment

Lists

Python  Lists Python Collections (Arrays) There are four collection data types in the Python programming language: List  is a ...