0% found this document useful (0 votes)
7 views2 pages

Python_List_Interview_Questions

The document contains a list of interview questions related to Python lists, covering topics such as list creation, manipulation methods, and list operations. Key questions include differences between methods like append and extend, techniques for removing items, and ways to sort and filter lists. It also addresses advanced concepts like list comprehension, merging lists, and handling duplicates.

Uploaded by

skagitha3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Python_List_Interview_Questions

The document contains a list of interview questions related to Python lists, covering topics such as list creation, manipulation methods, and list operations. Key questions include differences between methods like append and extend, techniques for removing items, and ways to sort and filter lists. It also addresses advanced concepts like list comprehension, merging lists, and handling duplicates.

Uploaded by

skagitha3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Python List Interview Questions

1. How do you create a list in Python?

2. What is the difference between list.append() and list.extend()?

3. How do you remove an item from a list?

4. How do you check if an item exists in a list?

5. How do you reverse a list?

6. What does list.copy() do?

7. How do you sort a list in ascending and descending order?

8. Whats the difference between list.remove(x) and del list[i]?

9. How do you find the index of an element in a list?

10. How do you count the occurrences of an item in a list?

11. What is list slicing and how is it used?

12. How do you merge two lists in Python?

13. What is list comprehension? Give an example.

14. How do you filter a list using list comprehension?

15. What is the difference between is and == when comparing lists?

16. How do you remove duplicates from a list while preserving order?

17. How do you flatten a nested list (e.g., [[1, 2], [3, 4]] [1, 2, 3, 4])?

18. How do you find all the duplicates in a list?

19. How do you find the intersection of two lists without using set()?

20. How do you rotate a list to the left or right (e.g., [1,2,3,4] [4,1,2,3])?

21. How can you insert an element at a specific position in a list?

22. How do you convert a list to a string and vice versa?

23. How do you split a list into chunks of equal size?

24. How can you iterate through a list with index and value together?
25. How can you remove all occurrences of a specific element from a list?

You might also like