All challenges
Multiple ChoiceBeginner 30s

getattr with Default

Choose the best answer for: getattr()
Options
  1. 1getattr(obj, 'attr', default) returns default if missing
  2. 2getattr raises an error even when a default is supplied
  3. 3getattr is the same as obj.attr and never takes a default
  4. 4getattr only works on modules and never on plain objects

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