Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shabbirbhimani/097d4fd9c04ae86332f3898a91ccb1a7 to your computer and use it in GitHub Desktop.
Save shabbirbhimani/097d4fd9c04ae86332f3898a91ccb1a7 to your computer and use it in GitHub Desktop.
Arithmetic Operators - special operators
# Let's declare variable variable1 with value 200, variable2 with value 30
variable1 = 200
variable2 = 3
print("value of variable1 is", variable1)
print("value of variable2 is", variable2)
# Performing modulus
modulusOutput = variable1 % variable2
print("Value of modulus is", modulusOutput)
# output: Value of modulus is 2
# Performing Exponent function
exponentOutput = variable1 ** variable2
print("Value of exponent is", exponentOutput)
#output: Value of exponent is 8000000
# Performing floor division
floorDivisionOutput = variable1 // variable2
print("Value of floor division is", floorDivisionOutput)
# output: Value of floor division is 66
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment