Skip to content

Instantly share code, notes, and snippets.

@fahdi
Last active February 4, 2023 02:59
Show Gist options
  • Save fahdi/8dc06f55ede9311c33257821e3009d89 to your computer and use it in GitHub Desktop.
Save fahdi/8dc06f55ede9311c33257821e3009d89 to your computer and use it in GitHub Desktop.
PEMDAS is an acronym used to help remember the order of operations in mathematics. It stands for: P: Parentheses E: Exponents MD: Multiplication and Division (performed left to right) AS: Addition and Subtraction (performed left to right) The order of operations is used to determine the sequence in which mathematical operations should be perform…
#PEMDAS
# PEMDAS is an acronym used to help remember the order of operations in mathematics. It stands for:
# P: Parentheses
# E: Exponents
# MD: Multiplication and Division (performed left to right)
# AS: Addition and Subtraction (performed left to right)
# The order of operations is used to determine the sequence in which mathematical operations should be performed to get the correct answer. When evaluating an expression, we start with the operations inside any parentheses, then exponents, then multiplication and division from left to right, and finally addition and subtraction from left to right. This helps to avoid ambiguity and ensures that the expression is evaluated consistently.
# true or true -> true
# true or false -> true
# false or false -> false
# false or true -> true
statement_one = (2 - 1 > 3) or (-5 * 2 == -10)
statement_two = (9 + 5 <= 15) or (7 != 4 + 3)
credits = 118
gpa = 2.0
if credits >= 120 or gpa >= 2.0:
print("You have met at least one of the requirements.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment