Python Conditionals and If Statements

Python Conditionals and If Statements

8th Grade

15 Qs

quiz-placeholder

Similar activities

Python Revision

Python Revision

7th - 9th Grade

14 Qs

Y9 Homework 1: Python Revisited 1

Y9 Homework 1: Python Revisited 1

9th Grade

13 Qs

Selection in Python

Selection in Python

1st - 9th Grade

15 Qs

Review Python

Review Python

8th Grade

15 Qs

Python Selection Statements

Python Selection Statements

11th Grade

10 Qs

Python Basics - Year 8

Python Basics - Year 8

7th - 9th Grade

14 Qs

Basics Python

Basics Python

8th - 10th Grade

20 Qs

Foundations of Programming

Foundations of Programming

9th - 10th Grade

18 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?