module 10 Flashcards

1
Q

What is the purpose of an IF statement in programming?

A

To make logical comparisons between a value and what you expect in order to choose between two alternate outputs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does the comparison operator ‘=’ signify in programming?

A

True when the value on the left is equal to the value on the right, otherwise False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How is equality represented in Python to avoid confusion with assignment?

A

With a double equal sign ‘==’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the comparison operator ‘>’ indicate?

A

True when the value on the left is greater than the value on the right, otherwise False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does the comparison operator ‘<’ indicate?

A

True when the value on the left is less than the value on the right, otherwise False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are Logical Operators used for in programming?

A

To combine situations when making decisions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Name three common logical operators used in programming.

A
  • AND
  • OR
  • NOT
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a disjunction in logical testing?

A

Combining two separate tests with the OR statement; if either condition is True, the cumulative answer is True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a conjunction in logical testing?

A

Combining two tests with the AND operator; both conditions must be True for the cumulative answer to be True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the NOT operator do in logical testing?

A

Flips an answer from True to False or vice versa

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is Boolean mathematics?

A

Combining test conditions using logical operators into an equation to answer compound questions with a final result of True or False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is Boolean Algebra?

A

A form of algebra that involves storing results of individual tests in Boolean variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the structure of an IF statement in Python?

A

It consists of a setup, a condition, and work (True code and False code)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the role of indentation in Python?

A

To identify a block of code, indicating that multiple instructions belong together

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is an algorithm?

A

A set of computer instructions that perform a specific task

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is hashing?

A

Generating an encoded value that cannot be converted back into the original message

17
Q

What is a hash value also known as?

A

A Transaction ID

18
Q

What does a hash value represent?

A

A cryptographic representation of the input message that uniquely identifies it

19
Q

What happens if the original message is altered in any way?

A

The altered message will have a different digital fingerprint and a different unique Transaction ID

20
Q

Fill in the blank: IF statements in programming are often called ______ statements.