We have learned about Creating Function on Python Programming Language on my writing before. Now, we have to know how to collect a sequence of value in a tuple, list, and dictonary.
There are differences among tuple, list, and dictionary. Let start our learning :
- Tuple.
Tuple is a sequence of value that is immutable.
What the meaning of immutable? It means that the sequence of value in the tuples can’t be changed (unchanged).
You can see examples below whether this is tuples or not :
More about tuple, just see examples below :
- List
List is a sequence of value that is mutable.
It means that the sequence of the list can be changed.
Just see the example of creating list below :
More about list :
List is mutable. So, we can add, delete, change, and modify the element of the list. Many operations and methods that we can do using list.
- List Oprations
- List methods
- Deleting list
- Dictionary
Dictionary is as like list but more general. In a list, to index value must use integer. it is different with dictionary, to index value is not only using integer but also using any type.
In dictionary, there are a set of key and a set of value ususally called key-value pair. Each key maps to a value. Let see example below :
I think it is good enough for our learing about Python Programming Language. You can try this learning with other problem. And you can improve more expert problem with this basic learning by your own so that you truly understand about this.I will try hard to write deeper about this topic on my next writing. So, please wait that. Good luck !