CodeHS Python Unit 7 Quiz Review

CodeHS Python Unit 7 Quiz Review

9th - 12th Grade

20 Qs

quiz-placeholder

Similar activities

Computer Science - X

Computer Science - X

8th - 10th Grade

20 Qs

4.6.4 Logic Gates

4.6.4 Logic Gates

10th Grade - Professional Development

15 Qs

Trắc nghiệm Bài 14_15 tin học K10

Trắc nghiệm Bài 14_15 tin học K10

10th Grade

20 Qs

Google

Google

7th - 12th Grade

20 Qs

BÀI 24-25 TIN 10

BÀI 24-25 TIN 10

10th Grade

20 Qs

Lecture Exercise Topic 1.3

Lecture Exercise Topic 1.3

12th Grade

21 Qs

Types of Computers

Types of Computers

10th Grade

20 Qs

แบบทดสอบบทที่ 1 เรื่อง ข้อมูลมีคุณค่า ม.5

แบบทดสอบบทที่ 1 เรื่อง ข้อมูลมีคุณค่า ม.5

10th Grade

20 Qs

CodeHS Python Unit 7 Quiz Review

CodeHS Python Unit 7 Quiz Review

Assessment

Quiz

Computers

9th - 12th Grade

Medium

Created by

Katy Fleming

Used 58+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

What is printed out by this program?

word = "killer whale"

print(word[0:100])

killer whal

“killer whale “

killer whale

The program will throw an error

2.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

Media Image

What does this function do?

  1. Returns the same sentence, but replaces every space with the letter char

Returns the same sentence, but adds the letter char after every space

Returns the same sentence, but adds the letter char after every letter in the sentence, except for spaces

Returns the same sentence, but adds the letter char after every letter in the sentence

3.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

Which of the following expressions will print “dog”?

Let sentence = "lazy dog"

print(sentence[6:])

print(sentence[:])

print(sentence[:5])

print(sentence[5:])

4.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

Which of the following expressions will print “L”?

Let word = "PINEAPPLE"

print(word[-4:])

print(word[-1])

print(word[-2])

print(word[-3])

5.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

On which line does this program throw an error?

1 word = "killer whale"

2 pos = word.find(" ")

3 word = word + "!"

4 word[pos] = "-"

Line 1

Line 2

Line 3

Line 4

6.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

Which of the following expressions will get the last character in a string? Assume that word is a string variable.

I. word[0]

II. word[-1]

III. word[len(word)]

IV. word[len(word)-1]

I, II, III

II, IV

II, III, IV

I, IV

7.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

Which of the following if statements checks if the string variable sentence contains the word “the”?

if "t" or "h" or "e" in sentence:

print("Contains 'the'")

if "the" in sentence:

print("Contains 'the'")

if "the" == sentence:

print("Contains 'the'")

if sentence in "the":

print("Contains 'the'")

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?