
String Formatting in Python
Authored by Teetreeo Pittman
Other
12th Grade
Used 6+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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
10 questions
BHS General Knowledge Test Quiz
Quiz
•
8th - 12th Grade
11 questions
TIGERS
Quiz
•
8th - 12th Grade
10 questions
Prime Ministers of India
Quiz
•
1st Grade - University
10 questions
Dragon Mania Ledgends Quiz
Quiz
•
1st Grade - Professio...
15 questions
Quis open loop dan close loop
Quiz
•
12th Grade
15 questions
Piaget Review
Quiz
•
10th - 12th Grade
15 questions
College Vocabulary 101
Quiz
•
9th - 12th Grade
10 questions
CSS QUIZ #3
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Other
20 questions
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
12 questions
Add and Subtract Polynomials
Quiz
•
9th - 12th Grade
13 questions
Model Exponential Growth and Decay Scenarios
Quiz
•
9th - 12th Grade
27 questions
7.2.3 Quadrilateral Properties
Quiz
•
9th - 12th Grade
7 questions
Amoeba Sisters Dihybrid Cross Punnett Square
Interactive video
•
9th - 12th Grade
10 questions
The Holocaust: Historical Overview
Interactive video
•
9th - 12th Grade
10 questions
Key Features of Quadratic Functions
Interactive video
•
8th - 12th Grade
11 questions
Exponent Quotient Rules A1 U7
Quiz
•
9th - 12th Grade