पाइथन (Python) Data Types क्या हैं?
In the next few classes we will develop a high level of understanding of Python. Once there is a high level of understanding, we will study each subject in depth. The first time we open the pie charm, we have to create a new project.
In this new project, we will give you the name we want. In this, the interpreter version is 3.8 as of today. After that we will create a new file. The extension of the Python file is .py. The basic command of a Python file is print.
If you run any program, its result will appear in the console window. The console window is below the purple line below where (Run python_var_tutorial) is written. Now we will talk about variables. We will learn what the variable is used for and what and what kind of information we can keep inside the variable. We can understand the variable as a character in which the program will use the value kept. Take the program below as an example. In this, the name Rakesh has been used four times.
If we want to keep information about another student in the program, we have to change the name in four places. To write a better program, we will put the student’s name in a variable. As shown in the program below .
We have made a variable named Student Name inside the four print statements. Now that variable has been given the value of the name Suresh. Now we have to make this change in just one place in the whole program. On running the program, we saw that the result came with a new value.
Python data types are of the following types.
Integer – full digits such as 2 , 4, 6
Dictionary – Unordered has value pairs (key: value pair). Such as{“name”: “john”, “age”: 22}
Floating type – the digit that has a decimal, such as 5.5, 9.7, 22.9
List – It contains objects in the manner listed. Like you make a list for shopping. [‘ Pencil’, ‘Notebook’, ‘Eraser’, ‘Pen’]
Tuple – It’s just like the list. But the order of the objects it contains is immutable. (‘ Pencil’, ‘Notebook’, ‘Eraser’, ‘Pen’)
Boolean – This analyzes the logical value or can be true or false
Set – It contains unordered objects that are not repeated.
Strings – These are characters placed in a sequential manner. It can be in the “” or ‘ format. Such as ‘John’, ‘246’, ‘Pencil’.
Understand the different braces used in the data type given above. For example, curly braces {} have been used in the dictionary. The square bracket [] has been used in the same list. When you repeatedly code Python, you will remember these things yourself. But initially these things have to be kept in mind, there is a slight difference between the tuple and the bracket in the list.
In the next class we will understand python’s data type in detail…
Please comment below and tell whether you understood this topic well or not. If you do not understand anything, then comment too. Will share more information about him.
nice info!!