Unit 5 Code hs

Unit 5 Code hs

9th Grade

22 Qs

quiz-placeholder

Similar activities

8th grade CS exam

8th grade CS exam

7th - 9th Grade

20 Qs

PowerPoint Basics!

PowerPoint Basics!

9th - 12th Grade

20 Qs

Looping Unit

Looping Unit

9th Grade

25 Qs

2.02 PowerPoint Basics

2.02 PowerPoint Basics

9th - 12th Grade

18 Qs

FOR

FOR

8th Grade - University

17 Qs

Photoshop

Photoshop

7th - 12th Grade

18 Qs

SLOVO contest

SLOVO contest

8th - 11th Grade

22 Qs

2016-MSITA-PPT-Lesson 2 Vocats Review

2016-MSITA-PPT-Lesson 2 Vocats Review

9th - 12th Grade

21 Qs

Unit 5 Code hs

Unit 5 Code hs

Assessment

Quiz

Other

9th Grade

Easy

Created by

birdy bird

Used 65+ times

FREE Resource

22 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How many lines will this program print?

while True:

print "hi"

0

1

an infinite number of lines

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How many lines will this program print?

x = 10

while x > 0:

print x

x = x - 3

3

4

5

6

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following programs prints ten lines?

for i from 0 to 9:

print "hi"

for i from 0 to 9:

print "hi"

for i = 1 to 10:

print "hi"

for i in range(10):

print "hi"

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following best describes the purpose of a for loop?

A for loop is for doing something an indeterminate number of times.

A for loop is doing something an infinite number of times.

A for loop is for doing something a fixed number of times.

A for loop is for doing something three times.

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which Python keyword skips back to the beginning of a loop?

break

continue

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

If I am using the following condition in my program:


while True:


Which keyword should I use to make sure I don’t create an infinite loop?

break

continue

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What does the following program print?


for i in range(2):

for j in range(2):

print i + j

0112

0

1

1

2

0

1

0

1

0101

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?