Search Header Logo

Python Conditionals and If Statements

Authored by Samuel Markham

Computers

8th Grade

Used 3+ times

Python Conditionals and If Statements
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

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

Access all questions and much more by creating a free account

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

Already have an account?