#7 - Data Types

Data Types

Our next step is going to be Data Types. But first, let's know what are data types.












What are data types?

Programming uses a number of different data types. A data type determines what type of value an object can have and what operations can be performed. Remember, this is one of the most important things in coding and affects the functioning and output of code.

Data types in Python

In python, we have 14 different data types in 7 categories.

Text Type:

str

Numeric Types:

intfloatcomplex

Sequence Types:

listtuplerange

Mapping Type:

dict

Set Types:

setfrozenset

Boolean Type:

bool

Binary Types:

bytesbytearraymemoryview

To get a data type of a value use type() function.

----------------------------------------------

code:-

print(type(50))

output:-

<class'int'>

------------------------------------------------

What Next?

Moving forward, we will be learning a very simple function that we use to take input from the user.

Input Function


Dudeme.in

Comments

Post a Comment

Popular Posts