Python Conditionals and If Statements

Python Conditionals and If Statements

8th Grade

15 Qs

quiz-placeholder

Similar activities

Foundations of Programming

Foundations of Programming

9th - 10th Grade

18 Qs

Python Revision

Python Revision

7th - 9th Grade

14 Qs

Python Programming Basics

Python Programming Basics

7th - 11th Grade

12 Qs

Algoritma Fungsi Phyton

Algoritma Fungsi Phyton

10th Grade

20 Qs

Python Basics - Year 8

Python Basics - Year 8

7th - 9th Grade

14 Qs

Python if/else

Python if/else

University

20 Qs

Python Boolean

Python Boolean

11th - 12th Grade

11 Qs

Python if statement

Python if statement

University

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?