
String Formatting in Python
Quiz
•
Other
•
12th Grade
•
Practice Problem
•
Medium
Teetreeo Pittman
Used 6+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the result of the following code? name = 'John' age = 25 message = 'My name is ' + name + ' and I am ' + str(age) + ' years old.' print(message)
My name is John and I am 25 years.
My name is John and I am 25 years old!
My name is John and I am 25 years old.
My name is John and I am 25.
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is string formatting with placeholders in Python?
A technique to convert strings into integers using placeholders and the % operator.
A method to concatenate strings in Python.
A way to remove values from a string using placeholders and the % operator.
A way to insert values into a string using placeholders and the % operator.
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the purpose of the + operator in Python?
The purpose of the + operator in Python is to perform addition or string concatenation.
The purpose of the + operator in Python is to perform subtraction.
The purpose of the + operator in Python is to perform multiplication.
The purpose of the + operator in Python is to perform division.
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the purpose of the * operator in Python?
The * operator in Python is used for addition of two numbers.
The * operator in Python is used for division of two numbers.
The * operator in Python is used for multiplication of two numbers or for repeating a string a certain number of times.
The * operator in Python is used for subtraction of two numbers.
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the purpose of the str() function in Python?
To convert any data type to a string data type
To create a new string variable
To convert a string to another data type
To delete a string variable
6.
FILL IN THE BLANK QUESTION
2 mins • 1 pt
Complete the following code to make the string all lowercase:
message = "My buddy Brandon is a GREAT basketball player for his age!"
print(message._____())
7.
MULTIPLE CHOICE QUESTION
1 min • 5 pts
Which answer completes the following code to capitalize the first letter of the first word?
bugsb = What's your favorite cartoon?
print(bugsb.______())
Swapcase
Upper
Capitalize
Isupper
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
0 questions
String Formats Quiz
Quiz
•
0 questions
Python Programming Quiz
Quiz
•
0 questions
String Methods in Python
Quiz
•
0 questions
Python Strings
Quiz
•
0 questions
Mastering Python String Techniques
Quiz
•
0 questions
String Operators in Python
Quiz
•
0 questions
Chapter 3 Test: Strings and Methods
Quiz
•
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Other
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
15 questions
Christmas Song Emoji Pictionary
Quiz
•
7th - 12th Grade
20 questions
Christmas Movies
Quiz
•
1st - 12th Grade
55 questions
CHS Holiday Trivia
Quiz
•
12th Grade
20 questions
Christmas Movie Trivia
Quiz
•
9th - 12th Grade
29 questions
christmas facts
Lesson
•
5th - 12th Grade
20 questions
Christmas Trivia
Quiz
•
5th - 12th Grade
20 questions
Stages of Meiosis
Quiz
•
9th - 12th Grade
