Learn with Yasir

Share Your Feedback

Python Lists True or False Questions – Practice for Beginners

Test your knowledge of Python lists with true or false practice questions. Strengthen your understanding of list operations, indexing, slicing, and common methods with instant feedback.

🔍 True or False

🟢 Beginner

  1. In Python, lists can contain elements of different data types.
  2. Answer

    ✅ True – Python lists are heterogeneous and can contain any mix of data types (e.g., [1, 'a', True, 3.14]).


  3. The index -1 in a list refers to the first element.
  4. Answer

    ❌ False – Negative indices count from the end, so -1 refers to the last element, -2 refers to the second last, etc.


  5. The slice my_list[1:3] includes the element at index 3.
  6. Answer

    ❌ False – Slicing is inclusive of the start index and exclusive of the end index, so it includes indices 1 and 2 but not 3.


  7. The append() method can add multiple elements to a list at once.
  8. Answer

    ❌ False – append() adds a single element to the end of the list. To add multiple elements, use extend() or += operator.


  9. Lists in Python are immutable.
  10. Answer

    ❌ False – Lists are mutable - their elements can be changed after creation, unlike tuples which are immutable.


🟡 Intermediate

  1. The expression `list('hello')` creates a list of individual characters.
  2. Answer

    ✅ True – When a string is passed to list(), it creates a list where each character becomes a separate element: ['h', 'e', 'l', 'l', 'o'].


  3. my_list[:] creates a shallow copy of the original list.
  4. Answer

    ✅ True – Using [:] without start or end indices creates a new list with all elements copied from the original.


  5. The sort() method modifies the original list and returns None.
  6. Answer

    ✅ True – sort() sorts the list in place and returns None, unlike sorted() which returns a new sorted list.


  7. The insert() method can add an element at any position in the list.
  8. Answer

    ✅ True – insert(index, element) allows you to add an element at any valid index, including at the beginning or end.


🔴 Advanced

  1. The slice my_list[::2] returns every third element of the list.
  2. Answer

    ❌ False – The step value of 2 returns every second element (elements at even indices), not every third element.


  3. The remove() method removes all occurrences of a value from a list.
  4. Answer

    ❌ False – remove() only removes the first occurrence of the specified value. To remove all occurrences, you need to use a loop or list comprehension.


  5. The clear() method and assigning an empty list [] are identical operations.
  6. Answer

    ❌ False – clear() modifies the existing list object, while assigning [] creates a new list object. This affects other references to the list.


📚 Related Resources