CS37 - Selection

CS37 - Selection

20 Qs

quiz-placeholder

Similar activities

Budgeting - Unit 10

Budgeting - Unit 10

9th - 12th Grade

20 Qs

Cuestionario sobre programación

Cuestionario sobre programación

KG - University

21 Qs

Pre-test CTCC0323

Pre-test CTCC0323

KG - University

18 Qs

Test5.01 Price is Right Laps

Test5.01 Price is Right Laps

9th - 12th Grade

20 Qs

Percents Unit Test Review Game

Percents Unit Test Review Game

7th Grade

21 Qs

The Entrepreneurial & Manager Mindset

The Entrepreneurial & Manager Mindset

10th Grade

20 Qs

MAY QUIZ

MAY QUIZ

Professional Development

20 Qs

CS37 - Selection

CS37 - Selection

Assessment

Quiz

others

Medium

Created by

Ian Jones

Used 1+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the primary purpose of an IF statement in programming?
To repeat a block of code multiple times
To execute a block of code only if a specified condition is true
To store multiple values in a single variable
To declare a variable

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct syntax for an IF statement in Python?
if x > 10 then:
if (x > 10) {
if x > 10:
if x > 10 end

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In an IF statement, what does the condition do?
Whether the statements inside the IF block will execute
Whether the loop should continue
The data type of the variable
The number of iterations for the loop

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following operators can be used in an IF statement to compare two values?
+
-
==
**

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In an IF-ELSE statement, what happens if the IF condition is false?
The ELSE block is executed
The IF block is executed
The program terminates
The program enters an infinite loop

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a nested IF statement?
An IF statement with multiple conditions
An IF statement inside another IF statement
An IF statement followed by an ELSE statement
An IF statement that repeats itself

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why might you use nested IF statements in your code?
To create a loop
To check multiple conditions sequentially
To simplify the code
To increase the complexity of the code

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?