CodeHS Python Unit 7 Quiz Review

Quiz
•
Computers
•
9th - 12th Grade
•
Medium
Katy Fleming
Used 58+ times
FREE Resource
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
What does this function do?
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
Similar Resources on Wayground
15 questions
Latihan 1. TIK Kelas 4 C

Quiz
•
10th Grade
19 questions
Python Loops Review

Quiz
•
9th - 12th Grade
15 questions
Microsoft Word Quiz

Quiz
•
10th Grade
15 questions
list in python

Quiz
•
10th - 12th Grade
20 questions
AQA GCSE Computer Science Paper 1

Quiz
•
9th - 11th Grade
25 questions
MS Word Basics Check-Up

Quiz
•
9th - 10th Grade
15 questions
Python programming language Quiz - Week 9

Quiz
•
9th Grade
20 questions
technology (Computer)

Quiz
•
3rd Grade - University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade
29 questions
AP CSP Unit 2 Review (Code.org)

Quiz
•
10th - 12th Grade