Module 2 - 1

0.0(0)
studied byStudied by 0 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/18

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

19 Terms

1
New cards

Flow control

The order of statement execution

2
New cards

Linear: one statement after another

By default, execution of code is

3
New cards

Boolean/condition expressions

Selection or decision statements are based on

4
New cards

None and False

Zero of any Numeric types (0, 0.0, 0j, etc.)

Empty Sequences

What is always False with boolean expressions (3)

5
New cards

if

elif

else

switch

Types of Selection/Conditional statements (4)

6
New cards

if

Block of code executes if a boolean expression is true. If the boolean expression is false, the block of code is skipped

7
New cards

elif

Must come under if or an elif. It will execute its block of code if the boolean expression is true and if the if/elif it is attached to evaluates to False

8
New cards

else

Must come under an if or elif and only one can be present per if block. It will execute if the if and all precending elif (if present) evaluate to False

9
New cards

switch

Lets the value of a variable determine where the program will branch to

10
New cards

Logical NOT

Logical AND

Logical OR

Boolean expressions can also use the following logical operators (3)

11
New cards

Logical NOT (logical negation, logical complement)

A unary operator that operates one operand

12
New cards

Logical AND and OR

Binary operators that operate on two operands

13
New cards

Mathematical operators have higher precedence than the relational and logical operators

Relational operators have higher precedence than logical operators

Precedence rules with Logical operators in boolean expressions (2)

14
New cards

Necessary

In python, indentation is

15
New cards

Nested if

An if statement can be put inside another if statement where the second if will be evaluated only if the first if evaluates to true

16
New cards

match

Provides another way to decide which statement to execute next and uses a variable and attempts to match the value to one of several possible cases

17
New cards

Case

Contains a value and a list of statements

18
New cards

Default case

A match statement can have an optional case that uses an underscore. If this is present, control will transfer to the default case if no other case value matches

19
New cards

Falls through to the statement after the switch statement

If there is no default case, and no other value matches control…