Python Conditionals Practice

Python Conditionals Practice

9th - 12th Grade

20 Qs

quiz-placeholder

Similar activities

FNaF1

FNaF1

4th - 12th Grade

19 Qs

Mengenal Jendela dan Ikon Microsoft Excel

Mengenal Jendela dan Ikon Microsoft Excel

7th Grade - University

15 Qs

Đề ôn tập cuối HKI lớp 5

Đề ôn tập cuối HKI lớp 5

6th Grade - University

17 Qs

PTS PWPB Kelas 11 Sem 1

PTS PWPB Kelas 11 Sem 1

11th Grade

21 Qs

SUMATIF MS WORD X E 4 DAN 5

SUMATIF MS WORD X E 4 DAN 5

10th Grade

20 Qs

3rd week g9 summative

3rd week g9 summative

7th - 12th Grade

15 Qs

TEST1.PY

TEST1.PY

10th Grade - University

20 Qs

Python. Функції

Python. Функції

9th Grade

17 Qs

Python Conditionals Practice

Python Conditionals Practice

Assessment

Quiz

Computers

9th - 12th Grade

Practice Problem

Medium

Created by

Mr Minyard

Used 12+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code print? ```python x = 5 if x > 4: print("Greater") else: print("Smaller") ```

Smaller

Greater

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code output? ```python a = 10 b = 20 if a > b: print("a is greater") else: print("b is greater") ```

a is greater

b is greater

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following code snippet print? ```python x = 15 if x < 10: print("Less than 10") elif x < 20: print("Between 10 and 20") else: print("20 or more") ```

Less than 10

Between 10 and 20

20 or more

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code. What will it print? ```python x = 5 y = 5 if x == y: print("x and y are equal") else: print("x and y are not equal") ```

x and y are equal

x and y are not equal

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code print? ```python x = 10 y = 20 if x > y: print("x is greater") elif x < y: print("y is greater") else: print("x and y are equal") ```

x is greater

y is greater

x and y are equal

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following nested conditional code print? ```python x = 5 if x > 0: if x < 10: print("x is a positive single-digit number.") ```

x is a positive number.

x is a positive single-digit number.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code print? ```python x = 12 y = 5 if x > 10 and y > 10: print("Both greater than 10") else: print("At least one is not greater than 10") ```

Both greater than 10

At least one is not greater than 10

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?