Dictionary Dictionary is one of the data structure in python, which holds a value with a key, it acts as an address book, for example just consider that while you apply ar fill different forms for the admission, each form is identified with a different name, and in the form, each column has a label, like (“Age:-_23_), here the name of the form is considered as a variable to store information, the ‘Age’ is considered as the keyword, and ‘23’ is considered as the value entered to the ‘keyword’ for ‘Age in the inside the variable form. It is denoted by curly bracket ‘{}’. Lets try with an example Input: A = {} type(A) Output: dict # dict is the short cut for Dictonary. Input: A[‘what is your name’] = ‘jack’ A Output: {‘what is your name’ : ‘jack’} Input: A[‘what is your name’] Output: ‘Jack’ Input: A[‘jack’] ------------------------------------------------------------------------...
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 ...