Posts

Showing posts with the label TUPLE

Tuple

Image
  Hey Shouters!! Today we learn about all the important functions and operations supported by tuples in python. In this tutorial, we will learn about all the important things about tuples. The main parts that we will learn about are: Introduction Creating Tuple Comprehension and Generator List and Dictionaries Operations over tuple Methods used in the tuple Tuple and Function Boolean and tuple Short Note Introduction Tuples are group of values within first brackets i.e. (1,2,3,'str',22.333). Tuples and Strings are immutable whereas list and dictionaries are mutable. Tuples are faster than lists. Tuple can be a dictionary keys but list cannot. Tuples can be used as values in sets whereas lists can not. Creating Tuple No. 1> There are a Tuple class and using tuple class constructor, you can create tuples as well as you can apply conversion like string to tuple, list to tuple and so on. Tuple allows indexing...