module 10 Flashcards
What is the purpose of an IF statement in programming?
To make logical comparisons between a value and what you expect in order to choose between two alternate outputs
What does the comparison operator ‘=’ signify in programming?
True when the value on the left is equal to the value on the right, otherwise False
How is equality represented in Python to avoid confusion with assignment?
With a double equal sign ‘==’
What does the comparison operator ‘>’ indicate?
True when the value on the left is greater than the value on the right, otherwise False
What does the comparison operator ‘<’ indicate?
True when the value on the left is less than the value on the right, otherwise False
What are Logical Operators used for in programming?
To combine situations when making decisions
Name three common logical operators used in programming.
- AND
- OR
- NOT
What is a disjunction in logical testing?
Combining two separate tests with the OR statement; if either condition is True, the cumulative answer is True
What is a conjunction in logical testing?
Combining two tests with the AND operator; both conditions must be True for the cumulative answer to be True
What does the NOT operator do in logical testing?
Flips an answer from True to False or vice versa
What is Boolean mathematics?
Combining test conditions using logical operators into an equation to answer compound questions with a final result of True or False
What is Boolean Algebra?
A form of algebra that involves storing results of individual tests in Boolean variables
What is the structure of an IF statement in Python?
It consists of a setup, a condition, and work (True code and False code)
What is the role of indentation in Python?
To identify a block of code, indicating that multiple instructions belong together
What is an algorithm?
A set of computer instructions that perform a specific task
What is hashing?
Generating an encoded value that cannot be converted back into the original message
What is a hash value also known as?
A Transaction ID
What does a hash value represent?
A cryptographic representation of the input message that uniquely identifies it
What happens if the original message is altered in any way?
The altered message will have a different digital fingerprint and a different unique Transaction ID
Fill in the blank: IF statements in programming are often called ______ statements.
Condition