Domanda di colloquio di Intel Corporation

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

Risposta di colloquio

Anonimo

15 ott 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).