Page 1 of 1

Python: Finding the Datatype

Posted: Fri Jul 18, 2025 2:04 am
by The Jason

Code: Select all

name = "Marge Simpson"

age = 35

gpa = 4.0

married = True

# Let's find the datatype of these variables

print(type(name))

# displays  <class 'str'>

Code: Select all


print(type(age))

# displays  <class 'int'>

print(type(gpa))

# displays  <class 'float''>

print(type(married))

# displays  <class 'bool''>