• HackTheShell

python basic data types



Data types


Data type is a significant concept in programming.


Variables may store different types of data, and specific types of data can do different things.


Python has constructed-in data forms in these categories, by default:



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

Data Type Examples:


String :-y="Hello World" 

int :- y = 20

float :-  y = 20.5

dict :-  y = {"name" : "any", "age" : 18}

bool :-  y = True

set :-  y = {"apple", "orange", "cherry"}

complex :-  y = 1j

range :-  y = range(6)





270 views

Recent Posts

See All

Python Operators

Arithmetic operators Assignment operators Comparison operators Logical operators Identity operators Membership operators Bitwise operators

©2020 by Hack The Shell.✒