Challenge: Updating Logic of the Function
Opgave
Swipe to start coding
Update the previous function to account for situations where the entered name isn't found in the dictionary.
- Within the function, implement an
if/elsestatement to verify if the key exists in the dictionary. - If the key isn't found, display the message
'There is no information about'followed by the value ofkey. - If the key exists, continue with the steps from the previous challenge to show the individual's details.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 6. Kapitel 10
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Suggested prompts:
Opsummér dette kapitel
Explain code
Explain why doesn't solve task
Fantastisk!
Completion rate forbedret til 1.67
Challenge: Updating Logic of the Function
Stryg for at vise menuen
Opgave
Swipe to start coding
Update the previous function to account for situations where the entered name isn't found in the dictionary.
- Within the function, implement an
if/elsestatement to verify if the key exists in the dictionary. - If the key isn't found, display the message
'There is no information about'followed by the value ofkey. - If the key exists, continue with the steps from the previous challenge to show the individual's details.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 6. Kapitel 10
single