PYTHON | Data Types

python data types,python data structures
python data types
















PYTHON : Data Type


Data : Data can define as representation of fact , instructions etc

Example  weights, prices, costs, numbers, names, addresses,Images, sounds, multimedia etc these  all a data 

Data types : Data types are the classification or categorization of data items

In python every value has data type. Like 

Python has the following data types built-in by default, in these categories:



                    

Text Data Type

Data Type Name

Text Type 

Str

Numeric Types

int, float, complex

Sequence Types

list, tuple, range

Mapping Type     

dict

Set Types

set, frozenset

Boolean Type

bool

Binary Types

bytes, bytearray, memoryview




Type() function

type() function is used for to get the data-type

Example

    x = 7
    y = 7.0
    z = '7'

    print( type (x) )
    print( type (y) )
    print( type (z) )

Output

    <class 'int'>
    <class 'float'>
    <class 'str'>


Also See






Post a Comment (0)
Previous Post Next Post