What does it mean when I do
print type(foo)
and get absolutely nothing?
foo is the response from an eBay REST search query, and it's supposed to be XML according to the eBay docs. When I
print foo
I get stuff -- a long string of values about ebay items all butted-up against one another.
Python type() The type() function either returns the type of the object or returns a new type object based on the arguments passed.
You need to call the function myFirstSubroutine() to get the output. Pay attention to that lowercase letter variable is not equal to capital letter variable in Python. That means you need to use exact the function name myFirstSubroutine() .
Syntax of the Python type() function The type() function is used to get the type of an object. Python type() function syntax is: type(object) type(name, bases, dict) When a single argument is passed to the type() function, it returns the type of the object. Its value is the same as the object.
Answer. Python type() is a built-in function that is used to return the type of data stored in the objects or variables in the program. For example, if a variable contains a value of 45.5 then the type of that variable is float.
It means type
is a function or other callable object that returns an empty string. Since the built-in function doesn't do that, you have most likely called another function type()
. Change the name of that function to something else. type_()
is good. Or _type()
, or somethingtype()
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With