Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Updating Logic of the Function | Functions in Python
Introduction to Python (dev copy)

bookChallenge: 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.

  1. Within the function, implement an if/else statement to verify if the name exists in the dictionary.
  2. If the name isn't found, display the message 'There is no information about' followed by the value of name.
  3. If the name exists, continue with the steps from the previous challenge to show the individual's details.

Løsning

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 6. Kapitel 10
single

single

Spørg AI

expand

Spørg AI

ChatGPT

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

close

Awesome!

Completion rate improved to 1.64

bookChallenge: 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.

  1. Within the function, implement an if/else statement to verify if the name exists in the dictionary.
  2. If the name isn't found, display the message 'There is no information about' followed by the value of name.
  3. If the name exists, continue with the steps from the previous challenge to show the individual's details.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

close

Awesome!

Completion rate improved to 1.64
Sektion 6. Kapitel 10
single

single

some-alt