What are the main data structures that I can use in Python

The main data structures in Python are tuples, lists, and dictionaries.

The main difference between them is that in tuples and lists the element order matters, while in dictionaries elements are associated to a given key. Plus, tuples are immutable, while lists and dictionaries are mutable, meaning that if you want to edit an element of a tuple, you have to create another tuple. Several are instead the operations that can be performed for list and dictionary manipulation.

Answered by Luca R. Python tutor

1368 Views

See similar Python Mentoring tutors

Related Python Mentoring answers

All answers ▸

Write a recursive function to return the nth Fibonacci number in Python


Create an algorithm that can be used as a guessing game. Make sure to import random at the start.


Define a function that takes in the age of the user and adds it to an output sentence such as "You are ..... old".


What can I do with Python?


We're here to help

contact us iconContact usWhatsapp logoMessage us on Whatsapptelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

© MyTutorWeb Ltd 2013–2025

Terms & Conditions|Privacy Policy
Cookie Preferences