Skip to main content

Posts

Showing posts with the label Tuple

Tuple - Data type of python

  Tuple                              The tuple is one of the data structures in python. A tuple is used to store multiple values in a variable, but the values after once entered cannot be changed, that’s why it is called immutable. For example, just consider that, you have gone to a restaurant or a hotel, so to pay the money you will get a bill which contains price, tax, etc, the values which are entered in these variable, like price, tax, etc… can not be change cone it is printed, likewise in ‘tuple’ when the values are entered once it cannot be changed. the tuple is represented as curve becker ‘()’ . Let us try with an example Input: Hotel_bill = (10,20,22,) Hotel_bill Output: (10, 20, 22) Input: type(hotel_bill) Output: tuple Input: hotel_bill[2] Output: 22 ...

Data Structure in python

  Data Structure in python  The data structure is one of the different and a special type of formate that is used for storing, processing,  retrieving , and, organizing the data. In other words, we can say that data structure is one of the techniques used to hold the data and use the data in an effective way , it is about rendering the data elements in terms of relationship, for better organizing and storing the data. Data structures are used in different field like  1) Artificial Intelligence 2)Graphics 3)Compiler design 4)Numerical Analysis 5)Simulations 6)Database Management System 7)Statistical Analysis Package 8)Opertating System Types of Data Structure and their uses  In Python it has four data structures, they are  1) List 2) Tuple 3) Dictionary and 4) Set.       Thank You