Data Types
Hey guys, in this blog we will discuss about “Data Types”. As we see, in programming, data types are important.
Different data types can do different things.
Python has data types in-built, they are as following:
1) str
2) int, float, complex (dealing with numerical
variables)
3) list, tuple, range (dealing with sequences)
4) dict (dealing with mapping types)
5) set, frozen set (dealing with set types)
6) bool(dealing with Boolean types)
7) bytes, bytearray, memoryview (dealing with
binary types)
Actually we will go in deep of the 4 data types, rest will come into data structures and built-in functions.
The four goes like this,
But further in the program, we can declare the data type for no
mistake. This practice is appreciated and creates zero errors.
Look at the code below,
We see that the output after declaring the data type is different for
different data types. In the string data type, 4.34 acts as a string rather
than a integer. Same goes with the rest.
We should be very clear while working out with
The data type, string, has
a bigger role in python. To know more, click here.
Hello Python people, for this blog we have taken help from the book Python : The Complete Reference.
If you still have any doubt on this topic then do come to us via email "sophomoretechs@gmail.com" or via instagram "@coding.winds".
Do subscribe to our daily blog update by clicking here.
Thank You!
No comments:
Post a Comment