With easy to understand examples for beginners!
Lists and dictionaries are the most widely used built-in data types in Python. This makes them also the best-known data types in Python. When it comes to tuples, grasping the details of how they differ from the lists is not an easy task for the beginners as they are very similar to each other.
In this article, I will explain key differences by providing examples for various use cases to better explain when to use tuples over lists.
So well, how they differ then?
The key difference between the tuples and lists is that while the tuples are immutable objects the lists are mutable. This means that tuples cannot be changed while the lists can be modified.
Let’s further understand how this effect our code in terms of time and memory efficiency.
Guide to Python Programming Language
Python is an interpreted, high-level, powerful general-purpose programming language. You may ask, Python’s a snake right? and Why is this programming language named after it?
Python Hello World Program - Your first step towards Python world. Learn how to create the Hello World Python program in PyCharm.
Python Programming Tutorials For Beginners
Today you're going to learn how to use Python programming in a way that can ultimately save a lot of space on your drive by removing all the duplicates. We gonna use Python OS remove( ) method to remove the duplicates on our drive. Well, that's simple you just call remove ( ) with a parameter of the name of the file you wanna remove done.