Python arithmatic and logical Operation


Python tutorials



Python arithmatic and logical Operation | Python tutorials Bestitworriors - Python Operation used to perform various function on python variables or values.There are many operation use on python variables or on values like Addition ( x + y or 2 + 4) Subtraction ( x - y or 4 - 3) and Multiplication ( x * y or 2 * 4) and Division ( x / y or 4 / 2) Modulus ( x % y or 2 % 4 ) and Exponentation ( x ** y or 2 ** 4) and Floor Division ( x // y or 4 // 2).Python perform assigning operation also like assign value to variable ( x = 2)




Some Key Points of Python Operations


  1. Python Operation use to perform functon on data or values
  2. Python operate Addition ( x + y or 2 + 4 )
  3. Python operate Subtraction ( x - y or 4 - 2 )
  4. Python operate Multiplication ( x * y or 2 * 4 )
  5. Python operate Division ( x / y or 2 / 4 )
  6. Python operate Modulus ( x % y or 2 % 4 )
  7. Python operate Exponentation ( x ** y or 2 ** 4 )
  8. Python operate Floor Division ( x // y or 2 // 4 )
  9. Python operate assignment ( x = 4 )
  


Code


var1 = 5
var2 = 4

addition = var1 + var2
print(addition)
substraction = var1 - var2
print(substraction)
multiplication = var1 * var2
print(multiplication)
division = var1 /var2
print(division)
modulus = var1 % var2
print(modulus)
exponentiation = var1 ** var2
print(exponentiation)
floordivision = var1 // var2
print(floordivision)







OutPut


9
1
20
1.25
1
625
1




I hope You really enjoyed this blog . I try my best to make every thing is easy and helpfull to provide to public .You will get more blog about the Programing project and code . Thanks for visiting my blog if you have any querry related to this you can comment here i will try my best to response you back about Python arithmatic and logical Operation | Python tutorials Bestitworriors