Python Arrays Questions and Answers
Python Programming - Arrays Questions with Answers explain how to store and access multiple values efficiently. These Python Arrays Questions are essential for TCS, SSC, and Infosys exams covering fundamental data structure concepts
Python Arrays
Showing 10 of
25 questions
21. How do you concatenate two lists?
- list1 + list2
- list1.concat(list2)
- list1.join(list2)
- list1.merge(list2)
23. How do you insert an element at a specific position?
- insert(index, element)
- add(index, element)
- put(index, element)
- set(index, element)
24. What is a shallow copy vs deep copy?
- Shallow copies references, deep copies objects
- Shallow is faster, deep is slower
- Shallow works for 1D, deep for 2D lists
- There is no difference
25. How do you convert a list to a tuple?
- tuple(list)
- list.tuple()
- convert_to_tuple(list)
- list.freeze()