38.2k views
0 votes
What does type(1024) return?
a. all of the below
b. str
c. float
d. int

1 Answer

4 votes

Final answer:

The Python function type(1024) will return 'int' because 1024 is an integer.

Step-by-step explanation:

When using the type() function in Python and passing the value 1024 to it, the function returns the type of the given value. In this case, the value 1024 is an integer, so the function will return int. This is because the numeral 1024 without any decimal point or quotations around it is interpreted as an integer in Python. A value like '1024' with quotations would be a string (str), while a value like 1024.0 with a decimal would be a float (float).

User Chris Bolton
by
8.4k points