I'm working on a simple program that will ask for the weather and temperature and output what clothing the user should wear. However, I've gotten to the point where I want to make sure the user can't enter "g" degrees or any other string. Is there a simple way to compare variable types? In other words, is there something along the lines of:
if (type(temp) == 'str'):
print("Invalid. Try again.")
Or something similar that isn't too complicated? Personally, I'm fine with using advanced functions and whatnot, but that would look sketchy to my CS teacher.