code: print(type(ValueError))
output: <class 'type'>
what does class 'type' mean! I just don't understand it?
code: print(type(ValueError))
output: <class 'type'>
what does class 'type' mean! I just don't understand it?
Objects have specific types (classes) associated with them.
"henlo"
is a str
type.
10
is an int
type.
["henlo", "goodbye"]
is a list
type.
and etc.
The ValueError
exception just has the class of type
. There's nothing else to it.
the type function returns a type
object that express the type of the object passed as argument, to get the type of an object only use type(ValueError)