PRO
Shawn
asked

Expert
Abhay Jajodia answered
Hi Shawn,
The main difference is in how they’re defined:
List → uses square brackets
[]my_list = [1, 2, 3]Tuple → uses parentheses
()my_tuple = (1, 2, 3)
If you're creating a tuple with just one item, you need a comma — otherwise, Python won’t treat it as a tuple:
single_item = (1) # This is just the number 1
single_item_tuple = (1,) # This is a tuple with one item
Lists don’t need a comma for single items, and you can freely change (mutate) them — unlike tuples, which are immutable.
If you have more questions, I am here to help.
Python
This question was asked as part of the Getting started with Python course.
Our Experts
Sudip BhandariHead of Growth/Marketing
Apekchhya ShresthaSenior Product Manager
Kelish RaiTechnical Content Writer
Abhilekh GautamSystem Engineer
Palistha SinghTechnical Content Writer
Sarthak BaralSenior Content Editor
Saujanya Poudel
Abhay Jajodia
Nisha SharmaTechnical Content Writer
Udayan ShakyaTechnical Content Writer