Last active
April 1, 2018 12:40
-
-
Save shabbirbhimani/097d4fd9c04ae86332f3898a91ccb1a7 to your computer and use it in GitHub Desktop.
Arithmetic Operators - special operators
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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