Back
Is there a simple way to determine if a variable is a list, dictionary, or something else? I am getting an object back that may be either type and I need to be able to tell the difference.
To determine the type of an object you can do that using type():-
a = [] type(a) f = () type(f)
a = []
type(a)
f = ()
type(f)
To know more about this you can have a look at the following video tutorial:-
31k questions
32.8k answers
501 comments
693 users