SlideShare a Scribd company logo
Working with List
1. Create three lists – a heterogeneous list, integer list, a list of animals.
2. Print the ascending order of the integer list, and the animal list.
3. Print the maximum and minimum number in the integer list.
4. Find the sum of elements in the integer list.
5. Reverse a list with and without using a function.
6. Consider a new list L = [23, 67, 12, 45, 78, 15, 90, 76, 63, 76, 52, 123] and extract the
following sub-lists.
a. Reverse a list with and without a function.
b. Extract a list [123, 52, 76, 63, 76, 90, 15, 78, 45, 12, 67, 23]
c. [23, 12, 78, 90]
d. First occurrence and last occurrence of 76.
e. Find the count of 76 in the list.
f. Print the entire list using slice operation.
g. Print the elements from position 2 to 8 with an interval 2.
h. Print the element from position 4 using slice operation.
i. Print the elements up to position 8 using slice operation.
j. Print the elements from position 3 with an interval of 3.
k. Update the element 555 at position 7 through indexing.
l. Add an element 888 to the end of the list using function.
m. Delete the element at position 6 using indexing and element at position 2 using
function.
n. Generate an empty list List1.
o. Check the emptiness of the list.
p. Insert elements in to the list using for loop after getting the number of
elements in the list to be inserted.
q. Print the list 3 times using the required operator.
r. Append the list [“apple”, “banana”, “cherry”] with the generated list.
s. Write the effect of remove ( ) in the generated list.
t. What will happen if you put a string inside list( ) function. Illustrate with an
example.
u. Generate a list with single element without using [ ].
v. Find the length of the generated list.
7. Traverse and print the list elements in a single line with a tab space.
8. Make the heterogeneous list as an empty list without using any function.
9. Prove the list property “mutable”.
10. Generate a list with the cube values of the list [2, 7, 9] using list comprehension
technique.
Working with tuples:
1. Generate a integer tuple, a string tuple with your friends name, a heterogeneous list
with your name, roll number, 5 marks and its average.
2. Create and print an empty tuple.
3. Prove immutability of the tuple.
4. Try deleting an element from the list. What happens?
5. Can you create a tuple inside a list?
6. Concatenate any two created tuples.
7. Find the min and max value in the tuple.
8. What will be the output when you convert a string to a tuple using the necessary
function.
9. Print the tuple for n times.
10. Compare two tuples after creating a tuple A and copying the same to tuple B.
11. What is tuple packing?
12. Find the index of third element in the tuple A.
13. Count the number of times x appears in the string “xaxxyxsttxggexxxxsx” using the
function count.
14. Can we convert the list into a tuple?
15. Illustrate the membership operators on a tuple.

More Related Content

PDF
beginners_python_cheat_sheet -python cheat sheet description
PPTX
11 Introduction to lists.pptx
PPTX
RANDOMISATION-NUMERICAL METHODS FOR ENGINEERING.pptx
PPTX
Chapter 3-Data structure in python programming.pptx
PPTX
Python PRACTICAL NO 6 for your Assignment.pptx
PDF
List,tuple,dictionary
PPTX
Module-2.pptx
beginners_python_cheat_sheet -python cheat sheet description
11 Introduction to lists.pptx
RANDOMISATION-NUMERICAL METHODS FOR ENGINEERING.pptx
Chapter 3-Data structure in python programming.pptx
Python PRACTICAL NO 6 for your Assignment.pptx
List,tuple,dictionary
Module-2.pptx

Similar to List & Tuple questions with seperate questions (20)

PDF
Beginner's Python Cheat Sheet
PDF
beginners_python_cheat_sheet_pcc_all (1).pdf
PDF
python cheat sheat, Data science, Machine learning
PDF
2. Python Cheat Sheet.pdf
PPTX
listtupledictionary-2001okdhfuihcasbdjj02082611.pptx
PDF
Python cheatsheet for beginners
PDF
1. python
PDF
Beginners python cheat sheet - Basic knowledge
 
PPTX
object oriented programing in python and pip
PPTX
Brief Explanation On List and Dictionaries of Python
PPTX
UNIT-3 python and data structure alo.pptx
PDF
Python list
PDF
numanalysis.py (30 points)A) Write a program that asks user to.pdf
PDF
Numpy
PPTX
Introduction To Programming with Python-4
PDF
2. numanalysis.py ( 30 points) A) Write a program that asks user to e.pdf
PPTX
institute of techonolgy and education tr
PDF
Python revision tour II
PPTX
Lists.pptx
Beginner's Python Cheat Sheet
beginners_python_cheat_sheet_pcc_all (1).pdf
python cheat sheat, Data science, Machine learning
2. Python Cheat Sheet.pdf
listtupledictionary-2001okdhfuihcasbdjj02082611.pptx
Python cheatsheet for beginners
1. python
Beginners python cheat sheet - Basic knowledge
 
object oriented programing in python and pip
Brief Explanation On List and Dictionaries of Python
UNIT-3 python and data structure alo.pptx
Python list
numanalysis.py (30 points)A) Write a program that asks user to.pdf
Numpy
Introduction To Programming with Python-4
2. numanalysis.py ( 30 points) A) Write a program that asks user to e.pdf
institute of techonolgy and education tr
Python revision tour II
Lists.pptx
Ad

More from ssuser80a5aa (8)

PDF
8.3. Advance III - algm to pgm 1.pdfAdvance I - Seminar.pdf
PDF
8.4. Advance III - algm to pgm 2.pdfAdvance I - Seminar.pdf
DOCX
Matrix Programs in C with steps and sollutions
DOCX
Shortened Linked List in C programming easy to learn for exam
DOCX
C Programming End Sem Question Set Question Paper with mark allocation
PPTX
Data Structures unit I just look to learn the contents
PPTX
Data Structures unit I just look to learn the contents
PPTX
Data Structures unit I just look to learn the contents
8.3. Advance III - algm to pgm 1.pdfAdvance I - Seminar.pdf
8.4. Advance III - algm to pgm 2.pdfAdvance I - Seminar.pdf
Matrix Programs in C with steps and sollutions
Shortened Linked List in C programming easy to learn for exam
C Programming End Sem Question Set Question Paper with mark allocation
Data Structures unit I just look to learn the contents
Data Structures unit I just look to learn the contents
Data Structures unit I just look to learn the contents
Ad

Recently uploaded (20)

PPTX
Software Engineering and software moduleing
PDF
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
PPTX
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
PPTX
communication and presentation skills 01
PDF
distributed database system" (DDBS) is often used to refer to both the distri...
PDF
22EC502-MICROCONTROLLER AND INTERFACING-8051 MICROCONTROLLER.pdf
PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
PPTX
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
PPTX
tack Data Structure with Array and Linked List Implementation, Push and Pop O...
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PPTX
Management Information system : MIS-e-Business Systems.pptx
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PPTX
Sorting and Hashing in Data Structures with Algorithms, Techniques, Implement...
PPT
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
PPTX
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
PDF
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PPT
Total quality management ppt for engineering students
PPTX
Fundamentals of safety and accident prevention -final (1).pptx
PDF
August -2025_Top10 Read_Articles_ijait.pdf
Software Engineering and software moduleing
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
communication and presentation skills 01
distributed database system" (DDBS) is often used to refer to both the distri...
22EC502-MICROCONTROLLER AND INTERFACING-8051 MICROCONTROLLER.pdf
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
tack Data Structure with Array and Linked List Implementation, Push and Pop O...
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
Management Information system : MIS-e-Business Systems.pptx
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
Sorting and Hashing in Data Structures with Algorithms, Techniques, Implement...
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
Total quality management ppt for engineering students
Fundamentals of safety and accident prevention -final (1).pptx
August -2025_Top10 Read_Articles_ijait.pdf

List & Tuple questions with seperate questions

  • 1. Working with List 1. Create three lists – a heterogeneous list, integer list, a list of animals. 2. Print the ascending order of the integer list, and the animal list. 3. Print the maximum and minimum number in the integer list. 4. Find the sum of elements in the integer list. 5. Reverse a list with and without using a function. 6. Consider a new list L = [23, 67, 12, 45, 78, 15, 90, 76, 63, 76, 52, 123] and extract the following sub-lists. a. Reverse a list with and without a function. b. Extract a list [123, 52, 76, 63, 76, 90, 15, 78, 45, 12, 67, 23] c. [23, 12, 78, 90] d. First occurrence and last occurrence of 76. e. Find the count of 76 in the list. f. Print the entire list using slice operation. g. Print the elements from position 2 to 8 with an interval 2. h. Print the element from position 4 using slice operation. i. Print the elements up to position 8 using slice operation. j. Print the elements from position 3 with an interval of 3. k. Update the element 555 at position 7 through indexing. l. Add an element 888 to the end of the list using function. m. Delete the element at position 6 using indexing and element at position 2 using function. n. Generate an empty list List1. o. Check the emptiness of the list. p. Insert elements in to the list using for loop after getting the number of elements in the list to be inserted. q. Print the list 3 times using the required operator. r. Append the list [“apple”, “banana”, “cherry”] with the generated list. s. Write the effect of remove ( ) in the generated list. t. What will happen if you put a string inside list( ) function. Illustrate with an example. u. Generate a list with single element without using [ ]. v. Find the length of the generated list. 7. Traverse and print the list elements in a single line with a tab space. 8. Make the heterogeneous list as an empty list without using any function. 9. Prove the list property “mutable”. 10. Generate a list with the cube values of the list [2, 7, 9] using list comprehension technique. Working with tuples: 1. Generate a integer tuple, a string tuple with your friends name, a heterogeneous list with your name, roll number, 5 marks and its average. 2. Create and print an empty tuple. 3. Prove immutability of the tuple. 4. Try deleting an element from the list. What happens?
  • 2. 5. Can you create a tuple inside a list? 6. Concatenate any two created tuples. 7. Find the min and max value in the tuple. 8. What will be the output when you convert a string to a tuple using the necessary function. 9. Print the tuple for n times. 10. Compare two tuples after creating a tuple A and copying the same to tuple B. 11. What is tuple packing? 12. Find the index of third element in the tuple A. 13. Count the number of times x appears in the string “xaxxyxsttxggexxxxsx” using the function count. 14. Can we convert the list into a tuple? 15. Illustrate the membership operators on a tuple.