Introduction Set is an unordered collection of elements with no duplicates. They can only contain immutable objects, therefore sets can’t contain list, dictionaries or another sets. Sets are usually used when someone needs to know whether a particular element is in a collection or not and the order itself does not matter. The good use
Introduction Tuples are very similar to lists in Python, but in contrast to lists they can’t be modified. Once you created the tuple, you can’t modify/delete/append its elements, therefore tuples are said to be immutable. How to create a tuple? Similarly to a list, a tuple contains sequence of values. To create a tuple, we
Introduction This article provides a lot of information about Python lists. We will learn how to create lists, append and delete elements, sort lists and create slices. List List is a collection(array) which contains ordered elements. Each element of a list has its own index. Lists can be modified and therefore are called “mutable” objects.
Introduction In this post we will have a look at several built-in data types in Python, like numbers, strings, lists and others. I will use Ubuntu 18.04 with Python 3.5.2 for demonstration, but you can use any Python 3 interpreter, for example Python IDLE for Windows or MacOS. $ python3 Python 3.5.2 (default, Nov 12