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
You've been provided with the list people
, which includes sub-lists detailing the names and ages of five individuals, as shown below:
Name | Age |
---|---|
Alex | 23 |
Noah | 34 |
Peter | 29 |
John | 41 |
Michelle | 35 |
To extract specific information using indexing, follow these steps:
- Display the details (the entire sub-list) of the fourth person.
- Display the name of the first person.
- Display the age of the fifth person.
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 4. Chapter 5
Challenge
Task
Swipe to show code editor
You've been provided with the list people
, which includes sub-lists detailing the names and ages of five individuals, as shown below:
Name | Age |
---|---|
Alex | 23 |
Noah | 34 |
Peter | 29 |
John | 41 |
Michelle | 35 |
To extract specific information using indexing, follow these steps:
- Display the details (the entire sub-list) of the fourth person.
- Display the name of the first person.
- Display the age of the fifth person.
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 4. Chapter 5
Switch to desktop for real-world practiceContinue from where you are using one of the options below