← BYTES
Python·Starter·Ref: 6.1.20

What does `type(3.0)` return?

Have a question about this video? Mention reference 6.1.20 when you contact us.

a.<class 'int'>
b.<class 'float'>
c.<class 'str'>
d.<class 'number'>
3.0 is written with a decimal point, making it a float literal, so `type()` reports `<class 'float'>` -- Python distinguishes float from int even for a value like 3.0 that happens to represent a whole number.

Find this on YouTube & Instagram

Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:

#BYTES#BYTES6120#Python