How can I tell if an object is a string, a list, or a dictionary in a program using if and ifelse so that I can perform a differnent action depending on the object's type?