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.
Inputs
form, a dictionary from field name to text; required, a list of field namesPrints
missing: [...] in the order of required, or completeExamplesthe starter's form →
missing: ['email', 'phone']Expected output1 line
- 1missing: ['email', 'phone']