
Mastering Python Strings (12A-B IT ESSENTIALS)
Authored by Imhotep Brooks
Computers
12th Grade
Used 12+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Python code?
lst = [3, 6, 9, 12]
lst.append(lst[2] * 2)
print(lst)
[3, 6, 9, 12, 12]
[3, 6, 9, 12, 18]
[3, 6, 9, 12, 6]
[3, 6, 9, 12, 24]
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you format a string using f-strings in Python?
Use f'string {variable}' to format a string with variables.
Use 'string {variable}' without f prefix.
Format strings with 'format()' method instead.
Concatenate variables using '+' operator.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Python code?
list1 = [1, 2, 3]
list2 = list1
list2.append(4)
print(list1)
[1, 2, 3]
[1, 2, 3, 4]
TypeError
[4, 1, 2, 3]
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method would you use to convert a string to Uppercase?
.lowercase()
.convertToLower()
.upper()
.toLowerCase()
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
x = "7.5"
y = int(float(x))
print(y, type(y))
7.5 <class 'int'>
7 <class 'int'>
7.5 <class 'float'>
TypeError
6.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
How can you slice the string 'Programming' to get 'program'?
print(x[2:7])
print(x[0:7])
print(x[3:8])
print(x[-4:])
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Python code?
x = 10 % 5
y = 10 // 3
z = x + y * 2
print(z)
9
8
6
5
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
11 questions
Cascading Style Sheets
Quiz
•
8th - 12th Grade
20 questions
Online Platform Block Q
Quiz
•
11th - 12th Grade
20 questions
City & Guilds Award in Business Processes
Quiz
•
12th Grade
11 questions
What is a computer
Quiz
•
KG - University
10 questions
EMPTECH L4 Q2
Quiz
•
12th Grade
10 questions
PRE-ASSESSMENT ETECH M1
Quiz
•
12th Grade
10 questions
Working with tables
Quiz
•
5th - 12th Grade
15 questions
Ôn tập kỳ 2 tin 6
Quiz
•
1st - 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