Conditionals Unit Quiz

Conditionals Unit Quiz

9th Grade - University

15 Qs

quiz-placeholder

Similar activities

CSS GRADE 9 - QUIZ PECs and EM

CSS GRADE 9 - QUIZ PECs and EM

9th Grade

20 Qs

UAS PTIK D 2020 TOPIK KHUSUS MULTIMEDIA

UAS PTIK D 2020 TOPIK KHUSUS MULTIMEDIA

University

20 Qs

BTEC Level 3 Nat Ext Dip in Computing - Unit 2.1 Hardware and Software

BTEC Level 3 Nat Ext Dip in Computing - Unit 2.1 Hardware and Software

11th - 12th Grade

10 Qs

conditional constructs in Java

conditional constructs in Java

10th Grade

10 Qs

CSS 10 - QUIZ

CSS 10 - QUIZ

10th Grade

20 Qs

Quiz on List and Tuples

Quiz on List and Tuples

University

16 Qs

CHỦ ĐỀ A. MÁY TÍNH VÀ XÃ HỘI TRÍ THỨC P1

CHỦ ĐỀ A. MÁY TÍNH VÀ XÃ HỘI TRÍ THỨC P1

10th Grade

20 Qs

Database Concepts

Database Concepts

11th - 12th Grade

15 Qs

Conditionals Unit Quiz

Conditionals Unit Quiz

Assessment

Quiz

Computers

9th Grade - University

Medium

Created by

Nathan Denton

Used 154+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What does this program print?

favorite_color = "blue"

if favorite_color != "blue":

if favorite_color != "red":

print("Must be yellow")

elif favorite_color == "blue":

if favorite_color != "yellow":

print("Must be blue")

elif favorite_color == "blue":

if favorite_color != "yellow":

print("I like purple")

else:

if favorite_color == "blue":

print("Blue is the best")

Must be yellow

Must be blue

I like purple

Blue is the best

Must be blue

Blue is the best

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How would you round the number held in the variable pi to 3.14?

pi = 3.14159265

round(pi)

round(pi, 3)

round(3, pi)

round(pi, 2)

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Why should you use round when you compare two numbers that have type float?

If you don’t, Python will only compare the whole part and discard the decimal part.

You don’t have to, but it’s good style. All of the comparisons will still work out the same way.

Sometimes numbers can be rounded in unexpected ways based on how Python computes them. Therefore, it is best to use round in order to make sure both numbers are rounded the same way.

You should always use round when you compare two numbers, even if they are of type int.

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will print to the screen when the following program is run?

number = 5

greater_than_zero = number > 0

print(type(number))

5

True

<type ‘int’>

<type ‘bool’>

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will print to the screen when the following program is run?

number = 5

less_than_zero = number < 0

print(type(less_than_zero))

5

False

<type ‘int’>

<type ‘bool’>

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of this program?

number = 5

greater_than_zero = number > 0

if greater_than_zero:

print(number)

o

5

True

Nothing will print

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of this program?

number = 5

greater_than_zero = number > 0

if greater_than_zero:

if number > 5:

print(number)

0

5

True

Nothing will print

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?

Discover more resources for Computers