PYTHON "If" Statement

PYTHON "If" Statement

Assessment

Flashcard

Computers

6th Grade

Practice Problem

Hard

Created by

Wayground Content

FREE Resource

Student preview

quiz-placeholder

10 questions

Show all answers

1.

FLASHCARD QUESTION

Front

In Python, what are if-statements used for?

Back

Decision Making

2.

FLASHCARD QUESTION

Front

What is the output of this code?
click = True
Like = 0
if click:
Like = Like + 1
print(Like)

Back

1

3.

FLASHCARD QUESTION

Front

What is the output of the following code?
Temperature = 20
Thermo = 15
if Temperature < 15:
Thermo = Thermo + 5
print(Thermo)

Back

15

4.

FLASHCARD QUESTION

Front

What is the output of the following code?
Time = "Day"
Sleepy = False
Pajamas = "Off"
if Time == "Night" and Sleepy == True:
Pajamas = "On"
print(Pajamas)

Back

off

5.

FLASHCARD QUESTION

Front

What will be the output of the following code?
def max(a, b):
if a > b:
print('a is the max')
else:
print('b is the max')
max(1,2)

Back

b is the max

6.

FLASHCARD QUESTION

Front

What will the be the output of the following code?
if (10<0) and (0 <-10):
print(“A”)
else:
print(“B”)
Options: A, B, AB, BA

Back

B

7.

FLASHCARD QUESTION

Front

Is the following statement true or false?

More than one condition cannot be used with an IF statement.

Back

False

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

Already have an account?

Discover more resources for Computers