Course Content
Introduction to Python
Introduction to Python
3. Conditional Statements
Boolean Data TypeChallenge: Comparison OperatorsCombining ConditionsChallenge: Logical OperatorsMembership Operators and Types ComparisonSimple if/else ExpressionsChallenge: Grocery StoreChallenge: Odd and Evenif/elif/else ExpressionsChallenge: Grocery Store ExtendedChallenge: Positive, Negative or Zero
Challenge
Task
Swipe to show code editor
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 name exists in the dictionary. - If the name isn't found, display the message
'There is no information about'
followed by the value ofname
. - If the name exists, continue with the steps from the previous challenge to show the individual's details.
Solution
Switch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?
Thanks for your feedback!
Section 6. Chapter 10
Challenge
Task
Swipe to show code editor
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 name exists in the dictionary. - If the name isn't found, display the message
'There is no information about'
followed by the value ofname
. - If the name exists, continue with the steps from the previous challenge to show the individual's details.
Solution
Switch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?
Thanks for your feedback!
Section 6. Chapter 10
Switch to desktop for real-world practiceContinue from where you are using one of the options below