Unit-II-Python 2024 batch-list examples

Quiz
•
Computers
•
University
•
Medium
Ajitha Padmanabhan
Used 1+ times
FREE Resource
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What would be the range of index values for a list of 10 elements?
0–9
0–10
1–10
none of the mentioned
2.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which one of the following is NOT a common operation on lists?
delete
replace
interleave
append
insert
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following would be the resulting list after inserting the value 50 at index 2?
none of the mentioned
4.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
How do you create an empty list in Python?
my_list = ()
my_list = {}
my_list = []
my_list = ()[]
5.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which method adds an element to the end of a list?
insert()
append()
add()
extend()
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
my_list = [1, 2, 3, 4, 5]
print(my_list[2])
1
2
3
4
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you delete the element 30 from the list my_list = [10, 20, 30, 40, 50]?
my_list.remove(30)
my_list.delete(30)
my_list.pop(30)
my_list.erase(30)
8.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following will correctly retrieve the last element of the list my_list = [10, 20, 30, 40, 50]?
my_list[-1]
my_list[len(my_list)]
my_list[-0]
my_list[5]
Similar Resources on Wayground
10 questions
2-列表与元组

Quiz
•
University
10 questions
Q2 - Python

Quiz
•
University
10 questions
Python Programming Quiz

Quiz
•
University
12 questions
Quiz3

Quiz
•
University
10 questions
PDS - 04225 Lists, Stacks and Queues - Chapter 5

Quiz
•
University
10 questions
Introducción a Python - Clase 7

Quiz
•
University
10 questions
Lists

Quiz
•
University
10 questions
Списки Python + Pygame

Quiz
•
KG - University
Popular Resources on Wayground
15 questions
Hersheys' Travels Quiz (AM)

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
30 questions
Lufkin Road Middle School Student Handbook & Policies Assessment

Quiz
•
7th Grade
20 questions
Multiplication Facts

Quiz
•
3rd Grade
17 questions
MIXED Factoring Review

Quiz
•
KG - University
10 questions
Laws of Exponents

Quiz
•
9th Grade
10 questions
Characterization

Quiz
•
3rd - 7th Grade
10 questions
Multiply Fractions

Quiz
•
6th Grade