Chapter 4 Test: Strings and Methods

Chapter 4 Test: Strings and Methods

20 Qs

quiz-placeholder

Similar activities

Lesson six - Sensing

Lesson six - Sensing

KG - University

17 Qs

Light and Matter

Light and Matter

KG - University

18 Qs

"Seventh Grade" by Gary Soto Review

"Seventh Grade" by Gary Soto Review

7th Grade

25 Qs

Unit 2 Vocabulary Exam POE

Unit 2 Vocabulary Exam POE

KG - University

22 Qs

MS-LS3-1 Common Assessment Review

MS-LS3-1 Common Assessment Review

7th Grade

21 Qs

Chapter 4 Test: Strings and Methods

Chapter 4 Test: Strings and Methods

Assessment

Quiz

others

Hard

Created by

Dottie Holland

FREE Resource

AI

Enhance your content

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

20 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

30 sec • 5 pts

Which of the following statements contain valid Python string literals? Select all that are correct:
string = 'Hello, world.'
string = "1234"
string = "We're #1!"
string = Hello, world.
string = 1234

2.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

What’s the value of x after this code snippet executes? x = "Real" + "Python"
'Real Python'
'RealPython'
' RealPython '
'realpython'

3.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

What’s the value of x after this code snippet executes? x = 1234 + 5
12345
'12345'
1239
'1239'

4.

FILL IN THE BLANK QUESTION

30 sec • 5 pts

Create a string literal with the following text: Spock said, "Live long and prosper." Assign the string to a variable named vulcan_logic. #hint: pay attention to your spacing

5.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

What’s the value of x after this code snippet executes? x = "1234" + 5
This fails with a TypeError
'12349'
'12345'
12345

6.

FILL IN THE BLANK QUESTION

30 sec • 5 pts

Suppose the following strings are defined: topping1 = "Peanut Butter" topping2 = "Jelly" Use string concatenation to create the string "Peanut Butter & Jelly" that is assigned to a variable named sandwich.

7.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

Characters:
individual letters or symbols in a string
the quotes surrounding a string
joins two strings
gets a single character from a string

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?