top of page

Python Datatypes

Updated: Apr 19, 2023

Python supports several data types.


They are string, int, float, list, tuple, range, dict, set, frozenset, bool, bytes, bytearray, memoryview and NoneType.




#string
a = "Hello!"
#int
b = 10
#float
c = 20.9
#list
d = [1,2,3]
#tuple
e = (10,20,30)
f = range(0, 10)
g = {
    "cycle": "ABC",
    "model": "A123",
    "year": 1900
}
#set
h = {1,2,3}
#frozenset
i = frozenset({1,2,3})
j = True
k = b"Wow!"
l = bytearray(10)
m = memoryview(bytes(10))
n = None
#complex
p = 2j
print(p)
#Type of variable
print(type(i))
print(m)

The link to the Github repository is here .




4 views

Related Posts

How to Install and Run Ollama on macOS

Ollama is a powerful tool that allows you to run large language models locally on your Mac. This guide will walk you through the steps to...

bottom of page