Maths
line-by-line explanation of your math operations in Python:
#!/bin/python3#mathMath operations:
print(50 + 50) # Addition β 100
print(60 - 50) # Subtraction β 10
print(50 * 50) # Multiplication β 2500print(50 + 50 - 50 * 50 / 50)
# Order of operations (PEMDAS):
# 50 * 50 = 2500
# 2500 / 50 = 50
# 50 + 50 - 50 = 50
# Final result β 50.0print(50 ** 2) # Exponentiation β 50^2 = 2500
print(50 % 8) # Modulus (remainder) β 50 Γ· 8 = 6 R2 β Result: 2
print(50 / 8) # Division β Result: 6.25
print(50 // 8) # Floor division β Result: 6 (no decimals)
Last updated