Python Conditionals and If Statements

Python Conditionals and If Statements

8th Grade

15 Qs

quiz-placeholder

Similar activities

Python String

Python String

12th Grade

20 Qs

CodeHS - Intro to Python - Conditionals Quiz

CodeHS - Intro to Python - Conditionals Quiz

9th Grade - Professional Development

15 Qs

Programming python review

Programming python review

9th - 12th Grade

15 Qs

Python Variables

Python Variables

7th - 12th Grade

10 Qs

Coding Basics

Coding Basics

11th - 12th Grade

15 Qs

Algoritma Fungsi Phyton

Algoritma Fungsi Phyton

10th Grade

20 Qs

Циклы

Циклы

9th Grade

16 Qs

Python elif and Nested if

Python elif and Nested if

12th Grade

15 Qs

Python Conditionals and If Statements

Python Conditionals and If Statements

Assessment

Quiz

Computers

8th Grade

Medium

Created by

Samuel Markham

Used 3+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet? ```python if 5 > 3: print("Hello") ```

Goodbye

Hello

Error

Nothing

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct if-elif-else structure in Python?

```python if x > 10: print("Greater") elif x == 10: print("Equal") else: print("Smaller") ```

```python if x > 10: print("Greater") else if x == 10: print("Equal") else: print("Smaller") ```

```python if x > 10: print("Greater") elif x == 10: print("Equal") else if: print("Smaller") ```

```python if x > 10: print("Greater") elif x == 10: print("Equal") ```

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

True

False

Error

None

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which comparison operator is used to check if two values are not equal?

==

!=

>

<

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? ```python x = 7 if x < 10: print("Small") else: print("Large") ```

Small

Large

Error

Nothing

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a Boolean expression?

"Hello"

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? ```python if False: print("Yes") else: print("No") ```

Yes

No

Error

Nothing

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?