What is the difference between list and tuples in Python?
Our today's topic is what's the difference between list and tuple in python.In order to understand this you first need to know what are lists and tuple in python.List and tuple are used as arrays in python.Lists are surmounted by square brackets while tuple are surmounted by paranthesis that is the basic visible difference between Lists and Tuples.
Now what are the programmitical difference between a List and a Tuple.According to official documentation Tuples are immutable i.e you cannot change the number of elements or the elements itself in a tuple on the other hand Lists are mutable i.e. changeable and we can add or remove items in a List.In python as arrays are not supported we use Lists as arrays which works the same or even better and many functionalities are already implemented.
Thanks for Reading
No comments: