Computer Science: Selection Statement (if-else) inside While Loop

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/10

flashcard set

Earn XP

Description and Tags

This set of vocabulary flashcards covers the fundamental concepts of using selection statements (if-else) within while loops as presented in the computer science lecture.

Last updated 11:10 AM on 6/7/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

11 Terms

1
New cards

While Loop

A programming structure that repeats instructions while a condition is true.

2
New cards

If Statement

A programming structure that checks a condition and runs code if that condition is true.

3
New cards

Syntax of a While Loop

whilewhile condition: statement/s

4
New cards

Syntax of an If-Else Statement

ifif condition: statement/s elseelse : statement/s

5
New cards

Indentation

A spacing format in Python that decides which statements belong inside the while, if, and else blocks.

6
New cards

Loop Variable Update

A required step where the counter or input must be changed (e.g., count=count+1count = count + 1) so the loop eventually stops.

7
New cards

Increment

The process of adding a value to a counter, such as count=count+1count = count + 1, to change the loop condition.

8
New cards

Selection

The process of decision making in code, such as choosing between "VIP Customer" and "Regular Customer" based on a condition.

9
New cards

Condition

A logical expression, such as count<=5count <= 5 or count==3count == 3, that determines the flow of the program.

10
New cards

Else Action

The instruction that is executed when the initial "if" condition is false.

11
New cards

Infinite Loop

What happens in a program if the counter update is missing, causing the loop to potentially run forever.