Control Structures - Selection in Python

Control Structures - Selection in Python

8th Grade

11 Qs

quiz-placeholder

Similar activities

Control Structure

Control Structure

9th Grade - University

12 Qs

Python Ifs, Lists, and Loops

Python Ifs, Lists, and Loops

7th - 8th Grade

11 Qs

Python Control Structures Vocab quiz

Python Control Structures Vocab quiz

9th - 12th Grade

14 Qs

KS4 Programming Techniques (1)

KS4 Programming Techniques (1)

8th - 10th Grade

10 Qs

Python

Python

8th Grade

12 Qs

CO - 2_ Quiz 1_Python Conditionals

CO - 2_ Quiz 1_Python Conditionals

10th Grade - University

15 Qs

Control Structures

Control Structures

University

14 Qs

🔦 Formative Assessment 2: Flow Controls

🔦 Formative Assessment 2: Flow Controls

12th Grade

10 Qs

Control Structures - Selection in Python

Control Structures - Selection in Python

Assessment

Quiz

Computers

8th Grade

Hard

Created by

Meenal Tripathi

Used 11+ times

FREE Resource

11 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

In this python code, what message is displayed if the student scores 34?

You passed. Well done!

You failed. Try again!

Invalid score.

Syntax error

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

In the attached python code, what is the purpose of converting num1 and num2 to integers?

To perform string operations

To compare them as numbers

To display them as text

To store them in a list

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be printed if num1 is 10 and num2 is 20 in the attached code?

First number is greater than the second

Second number is greater than the first

Numbers are equal

Invalid input

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

In this example, which part of the if-statement will be executed if the input speed is below 40 mph?

if speed >= 70:

elif speed >=40:

else:

input("Enter driver's speed")

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What type of control structure is used in selection?

for loop

while loop

if-else statement

switch-case statement

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

In this example, what will be the output if num1 is 25 and num2 is 25?

1st bigger than 2nd

2nd bigger than 1st

Numbers are equal

No output

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the elif statement in an if-elif-else statement?

To handle multiple conditions

To repeat a block of code

To define a function

To initialize variables

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?