Week 6 - Conditional Statements in Python

Week 6 - Conditional Statements in Python

University

15 Qs

quiz-placeholder

Similar activities

Stats+Python ISA Test - Quiz 2

Stats+Python ISA Test - Quiz 2

University - Professional Development

20 Qs

TECH GEE Check on Learning

TECH GEE Check on Learning

University

13 Qs

PLC LINK & DATA MANIPULATION

PLC LINK & DATA MANIPULATION

University

14 Qs

IPS_Quiz1_Chapter1

IPS_Quiz1_Chapter1

University

15 Qs

Python Basic II

Python Basic II

11th Grade - University

20 Qs

GUIA TECNOLOGIA 2

GUIA TECNOLOGIA 2

8th Grade - University

15 Qs

Java Script Pro

Java Script Pro

3rd Grade - University

12 Qs

its the future

its the future

8th Grade - Professional Development

18 Qs

Week 6 - Conditional Statements in Python

Week 6 - Conditional Statements in Python

Assessment

Quiz

Instructional Technology

University

Medium

Created by

Rommel Sario

Used 3+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be the output of the following Python code?

x is greater than 10

x is 10 or less

No output

Error

Answer explanation

Since x = 7, the condition x > 10 is False, so the code in the else block is executed.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be the output of the following Python code?

Even

Odd

5

No output

Answer explanation

Since 5 % 2 != 0, the condition is False, so the else block prints Odd.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be the output of the following Python code?

x is 20 or more

x is between 10 and 20

x is 10 or less

No output

Answer explanation

Since x = 15, the first condition (x > 10) is True, and the nested condition (x < 20) is also True, so it prints the message in the second if block.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be the output of the following Python code?

Young adult

Not a young adult

Error

No output

Answer explanation

Both conditions (age >= 18 and age < 30) are True, so the if block is executed.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be the output of the following Python code?

A

B

C

No Output

Answer explanation

The condition score >= 90 is False, but score >= 80 is True, so it prints B.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be the output of the following Python code?

Equal

Not equal

Error

No output

Answer explanation

Since x is not equal to y, the else block runs and prints Not equal.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be the output of the following Python code?

Hot

Warm

Cold

No output

Answer explanation

The first condition (temp > 50) is False, but the second condition (temp > 30) is True, so it prints Warm.

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?

Discover more resources for Instructional Technology