## Primitives Variables and Expressions

• To perform operations on the Variables we need operators
Operator Description
x – y Subtraction
x * y Multiplication
x / y Division
x // y Integer Division or Truncating Division
x % y Modulo (Remainder)
-x Unary minus
+x Unary plus
x ** y x to the power of y • Common Mathematical functions
Function Description
abs(x) Absolute value
divmod(x,y) Returns (x//y, x%y)
round(x, [n]) Round to the nearest multiple of nth power
• Comparision operators
Operator Description
x == y Equals to
x != y Not equals to
`x < y` Less than
`x > y` greater than
`x >= y` greater than or equals to
`x <= y` Less than or equals to
• Logical Operators
Operator Description
x or y if either x or y is true it returns true, false otherwise
x and y if both x and y are true returns tru, false otherwise
not x if x is true returns false and if x is false returns true
• Samples:
• Refer Here for the samples created
• Write expression in a python file to find the value of y • Write a python expression for the below value ``````y = x ** 2 * z ** 2 /4
``````
• Write a python expression for below value  This site uses Akismet to reduce spam. Learn how your comment data is processed. 