FOC - Lesson 5: Control Structures

5.0(2)
Studied by 37 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/20

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 7:49 AM on 12/21/24
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

21 Terms

1
New cards

Control Structures

is a block of statements that analyzes variables and chooses a direction in which to go based on a given parameter.

2
New cards

Sequence Control Structures

is a line-by-line execution of statements sequentially in the same order in which they appear in the script.

3
New cards

Decision Control Structures

is a control structure that depends on whether a condition is true or false.

4
New cards

Decision Control Structures

This structure may skip the execution of an entire block of statements or even execute one block of statements instead of another.

5
New cards

Loop Control Structures

is a structure that allows the execution of a block of statements multiple times until a specified condition is met.

6
New cards

if statement

in Python, it is used to implement a decision

7
New cards

Simple Decision

has a form of:

if <condition>:

body

8
New cards

Two-way Decision / if-else statement

has the form of:

if <condition>:

statements

else:

statements

9
New cards

multi-way decision

structure in programming is a structure wherein a decision is nested inside another decision.

10
New cards

multi-way decision

It has the form of:

if <condition1>:

<case1 statements>

elif <condition2>:

<case2 statements>

elif <condition3>:

<case3 statements>

. . .

else:

<default statements>

11
New cards

Definite Loops

It is a type of loop where the number of iterations/repetitions is known before the start of the execution of the body of the loop.

12
New cards

Definite Loops

It is implemented by using count-controlled loops.

13
New cards

Indefinite Loops

It is a type of loop where the number of iterations/repetitions is not known before the start of the execution of the body of the loop.

14
New cards

Indefinite Loops

It is implemented by using condition-controlled loops.

15
New cards

loop index

is a variable that is used to control a loop.

16
New cards

range function

it will produce a sequence of numbers that starts with 0 and goes up to, but does not include, the value of <expr>.

17
New cards

range (start,n)

This function produces a sequence that starts with the value start and continues up to, but does not include n.

18
New cards

range (start, n, step)

This function is like the two-parameter version, except that it uses step as the increment between numbers.

19
New cards

accumulator pattern

is a common programming pattern in which a final answer is built a piece at a time in a loop.

20
New cards

while statement

In Python, an indefinite loop is implemented using a __________

21
New cards

while statement

has this form:

while <condition>:

<body>