What is the output of the following code snippet?
my_list = [1, 2, 3, 4, 5]
my_list.append(6)
print(my_list)
Python Basics
Quiz
•
Computers
•
University
•
Hard
Cheshtaa Bhardwaj
Used 67+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
What is the output of the following code snippet?
my_list = [1, 2, 3, 4, 5]
my_list.append(6)
print(my_list)
[1, 2, 3, 4, 5]
[1, 2, 3, 4, 5, 6]
[1, 2, 3, 4, 5, [6]]
[1, 2, 3, 4, 5, (6)]
2.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Which of the following statements is true about tuples in Python?
Tuples are mutable.
Tuples are ordered.
Tuples can have duplicate elements.
Tuples use curly braces {} for initialization.
3.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
What is the purpose of a Python dictionary?
To store data in an ordered sequence.
To store data as key-value pairs.
To store data in a sorted manner.
To store data in a linear structure.
4.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Which of the following methods in Python is used to find the length of a string?
length()
count()
size()
len()
5.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
What will be the output of the following code snippet?
x = 10
if x > 5:
print("Greater than 5")
else:
print("Less than or equal to 5")
"Greater than 5"
"Less than or equal to 5"
"x is equal to 5"
"x is greater than 10"
6.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
data = "No Way!" The expression len(data) evaluates to:
6
7
8
9
7.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Which operator returns True if target string is somewhere in the search string; otherwise it returns False.
==
!=
is
in
10 questions
DATA STRUCTURES ACTIVITY OF THE WEEK
Quiz
•
University
20 questions
Python Quiz - BPLCK105B
Quiz
•
University
17 questions
PYTHON-QUIZ-2023
Quiz
•
University
10 questions
Tin Học 10 bài 19
Quiz
•
10th Grade - University
18 questions
Kiểu dữ liệu xâu kí tự trong Python
Quiz
•
10th Grade - University
20 questions
OOP Data Types
Quiz
•
University
20 questions
Artificial Intelligence
Quiz
•
University
10 questions
H466 - Arrays, Records, Tuples and Lists
Quiz
•
11th Grade - University
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade