
String Formatting in Python

Quiz
•
Other
•
12th Grade
•
Medium
Teetreeo Pittman
Used 6+ times
FREE Resource
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
Create a free account and access millions of resources
Similar Resources on Wayground
8 questions
Python Certification: Objective 1&2

Quiz
•
12th Grade
10 questions
Java Strings

Quiz
•
1st Grade - Professio...
10 questions
Lists 10

Quiz
•
12th Grade
9 questions
Знайомство з Python

Quiz
•
12th Grade
12 questions
Telephone Systems Quiz

Quiz
•
10th - 12th Grade
10 questions
Snakes

Quiz
•
3rd Grade - Professio...
10 questions
Careers in Fashion

Quiz
•
9th - 12th Grade
10 questions
Soalan Uji Kefahaman (Kod Segmen)

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Other
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
6 questions
Rule of Law

Quiz
•
6th - 12th Grade
15 questions
ACT Math Practice Test

Quiz
•
9th - 12th Grade
18 questions
Hispanic Heritage Month

Quiz
•
KG - 12th Grade
28 questions
Ser vs estar

Quiz
•
9th - 12th Grade
10 questions
Would you rather...

Quiz
•
KG - University
13 questions
BizInnovator Startup - Experience and Overview

Quiz
•
9th - 12th Grade