runtime
74 / 500
question 74 Dictionaries & Sets · easy

Required fields on a sign-up form

A sign-up form arrives as a dictionary from field name to the text typed in it. Some fields are required. A required field is missing if its key isn't in the form, or if its text is empty or only spaces. Print missing: followed by the list of missing fields, in the order of required, or complete if none are missing. Fields that aren't required are ignored.

Inputsform, a dictionary from field name to text; required, a list of field names
Printsmissing: [...] in the order of required, or complete
Examplesthe starter's form → missing: ['email', 'phone']
Expected output1 line
  1. 1missing: ['email', 'phone']

Loading your progress…

Required fields on a sign-up form — Python practice · Runtime