In programming, data type is an important concept. In this article, I am going to discuss Data Types in Python with Examples. The data can be categorized into different types like integers, float numbers, boolean, string, etc. Categorizing the data is important in order to perform the operations on it. Python variables can store data of different types, and different types can do different things.
Python Built-in Data Types:
Python has the following built-in data types
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 |
None Type | NoneType |
Example of data type:
x = 20 # int
x = 20.5 # float
x = 1j # Complex
x = ["one", "two", "three"] #list
x = range(6) #range
x = ("one", "two", "three") #tuple
x = {"name" : "John", "age" : 36} #dict
x = True #bool
x = b"Hello" #bytes
x = bytearray(5) #bytearray
x = None #NoneType
- Python 10 Programs for Beginners
- AI Roadmap using Python
- Explain about Hugging Face Transformers
- What are Large Language Models
- Create new Python Virtual environment
- Find index of first occurrence when an unsorted array is sorted
- Find sum non repeating distinct elements array
- Find the only different element in an array
- Queries to find first occurrence of a character in a given range
- Program count occurrences of given character in string
- Find repeating element in sorted array of size n
- Find only non repeating element in a given array
- Python replace all occurrences of a substring in a string
- Count occurrences of a sub string with one variable character
- Python string replace
- Python string strip
- Slicing with negative numbers in Python
- Python Slice Function
- String Slicing in Python
- Python String
- Chainmap in Python
- Collections Userlist in Python
- Collections Userstring in Python
- Defaultdict in Python
- Deque in Python
- Namedtuple in Python
- Ordereddict in Python
- Counters in Python
- Python list
- Python Dictionary
- Python Tuples
- Collections Userdict in Python
- Python Collections Module
- end and sep in Python
- f-strings in Python
- Input and Output in Python
- Variables in Python
- Data Types in Python
- Operators in Python
- Python program to compute net run rate
- Python program to get biggest number
- Python program to count the frequency of every element
- Python program of list and swap its content
- Python program to get max numbers
- Python program to generate patterns
- Python Program to Check Armstrong
- Python program to print multiplication table
- Python program for domestic electricity bill
- Python program to find maximum number
- Python program to check uppercase or lowercase letter
- Python tutorials
- Python QuickStart
Comments are closed.