DEV Community

hebaShakeel
hebaShakeel

Posted on

Data Types in Python

Python supports 3 categories of data types:

  1. Basic Types -integer, float, complex, boolean and string
  2. Container Types - List, tuples, sets and dictionary
  3. User-defined Types - Classes

Integer

print(4)

Floats

print(4.5)

Boolean

print(True)

Complex

print(4+5j)

Strings

print('Mumbai')
print("Mumbai")

List

print([1,2,3,4,5])

Tuple

print((1,2,3,4,5))

Sets

print({1,2,3,4,5})

Dictionaries

print({"Name": "Heba", "Age" : 30, "gender": "Male"})

Top comments (0)