Intel Corporation Interview Question

What is the difference between a list and a tuple in Python?

Interview Answer

Anonymous

Oct 15, 2024

Lists are defined using square brackets, e.g., my_list = [1, 2, 3], while tuples are defined using parentheses, e.g., my_tuple = (1, 2, 3).