An expression is the combination of the operator and operands that is interpreted to produce some output value.
+
: Addition
-
: Substraction
*
: Multiplication
/
: Division
**
: Power | Expectation
%
: Remainder
Higher precedence rule to lowest precedence rule:
num = 123
print(num)
type(num)
num1 = 123.3
type(num1)
name = "John"
print(name)
type(name)
print(float(99) + 100) #199.0
i = 42
type(i)
f = float(i)
print(f)
type(f)
print(10/2) #5.0
print(9/2) #4.5
print(99/100) #0.99
print(10.0/2.0) # 5.0
print(99.0/100.0) #0.99
int()
and float()
to convert between string and integers.str = "123"
type(str)
num = int(str)
type(num)
print(num)