All challenges
Multiple ChoiceBeginner 30s

hasattr builtin

Choose the best answer for: hasattr()
Options
  1. 1hasattr sets an attribute on the object if it is missing
  2. 2hasattr is a dict method for looking up stored keys
  3. 3hasattr deletes attributes that are no longer needed
  4. 4hasattr(obj, 'attr') checks if attribute exists

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle