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

bookChallenge: Updating Logic of the Function

Task

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/else statement 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 of key.
  • If the key exists, continue with the steps from the previous challenge to show the individual's details.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 6. ChapterΒ 10
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Suggested prompts:

Summarize this chapter

Explain the code in file

Explain why file doesn't solve the task

close

Awesome!

Completion rate improved to 1.67

bookChallenge: Updating Logic of the Function

Swipe to show menu

Task

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/else statement 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 of key.
  • If the key exists, continue with the steps from the previous challenge to show the individual's details.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

close

Awesome!

Completion rate improved to 1.67
SectionΒ 6. ChapterΒ 10
single

single

some-alt