Created
August 26, 2021 16:30
-
-
Save pamelafox/f721b4c0e4eede9fefd5938042938628 to your computer and use it in GitHub Desktop.
Operator Expressions Exercise
This file contains hidden or 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
from operator import add, sub, mul, truediv, floordiv, mod | |
""" | |
In the console, type expressions that use function calls | |
and correspond to each arithmetic expression. | |
Use the console to check your work. | |
Useful documentation: | |
https://docs.python.org/3/library/operator.html#mapping-operators-to-functions | |
""" | |
# Q1: 30 + 2 | |
# Q2: 30 - 2 | |
# Q3: 30 * 2 | |
# Q4: 30 / 2 | |
# Q5: 30 % 2 | |
# Nested! | |
# Q6: 30 + (2 * 4) | |
# Q7: 3 * (10 - 2) | |
# Challenge! | |
# Q8: (3 ** (365/52)) - 1 | |
# Q9: (25 // 4) - (25 / 4) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment