What will be the output of the following Python code?
lst = [3, 6, 9, 12]
lst.append(lst[2] * 2)
print(lst)
Mastering Python Strings (12A-B IT ESSENTIALS)
Quiz
•
Computers
•
12th Grade
•
Medium
Imhotep Brooks
Used 12+ times
FREE Resource
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
16 questions
Python Basics
Quiz
•
KG - University
20 questions
LETS PLAY QUIZ - PYTHON CBSE CLASS XII
Quiz
•
11th - 12th Grade
20 questions
Python Recap
Quiz
•
7th Grade - University
14 questions
Section 4A: Decompose the code using functions
Quiz
•
12th Grade
15 questions
Quiz 142 - Python inputs and outputs
Quiz
•
9th Grade - University
20 questions
String Data Type(Python)
Quiz
•
12th Grade
15 questions
PYTHON PROGRAMMING
Quiz
•
11th - 12th Grade
15 questions
Python Basics
Quiz
•
KG - University
15 questions
Multiplication Facts
Quiz
•
4th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions
Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines
Quiz
•
Professional Development
12 questions
Dividing Fractions
Quiz
•
6th Grade