World's Best AI Learning Platform with profoundly Demanding Certification Programs
Designed by IITians, only for AI Learners.
Internship Partner

In Association with
In collaboration with



Designed by IITians, only for AI Learners.
Internship Partner
In Association with
In collaboration with
New to InsideAIML? Create an account
Employer? Create an account
Designed by IITians, only for AI Learners.
Internship Partner
In Association with
In collaboration with
Enter your email below and we will send a message to reset your password
Designed by IITians, only for AI Learners.
Internship Partner
In Association with
In collaboration with
By providing your contact details, you agree to our Terms of Use & Privacy Policy.
Already have an account? Sign In
Designed by IITians, only for AI Learners.
Internship Partner
In Association with
In collaboration with
By providing your contact details, you agree to our Terms of Use & Privacy Policy.
Already have an account? Sign In
Download our e-book of Introduction To Python
4.5 (1,292 Ratings)
589 Learners
Pallavi Dhotre
5 months ago
Parameters | Lists in Python | Tuples in Python |
Nature | Mutable or changeable | Immutable or cannot change |
Iteration | Iterating through Lists is time-consuming | Iterating through Tuples is not time-consuming |
use | Good for insertion-deletion | Good for accessing elements |
memory | Requires more memory as compare to Tuples | Requires less memory as compared to Lists |
deletion | The List can delete any particular element | Tuples cannot delete elements rather it can delete a whole tuple |
creation | To create a List we can use the following waysdemo_List = [ ] #empty Listdemo_List = [1,2,3,4] #List with integer valuesdemo_List = ['Ram', 'Sham', 'Siya'] #List of strings | To create a Tuple we can use the following ways#Python Tuple exampledemo= ( ) #empty Tupledemo=(1, ) #Tuple with a single elementdemo= (1,2,3,4) #Tuple with integer valuesdemo= ('Ram', 'Sham', 'Siya') #Tuple of strings |
accessing elements | To get an entry from the List we use index numbers of the List. See the following example for more details:demo_List = ['Ram', 'Sham', 'Siya'] #List of stringsprint (demo_List [0]) # access the first elementprint (demo_List [1]) # access the second elementprint (demo_List [2]) # access the third elementOutput:RamShamSiya | To get an entry from the Tuple we use index numbers of the Tuple. See the following example for more details:demo_List = ['Ram', 'Sham', 'Siya'] #Tuple of stringsprint (demo_Tuple [0]) # access the first elementprint (demo_Tuple [1]) # access the second elementprint (demo_Tuple [2]) # access the third elementOutput:RamShamSiya |