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 a tuple named people
that holds data on individuals' names, ages, and heights in the format: (('name', age, height), ('name', age, height), ...)
. Here's a snapshot of the data:
Name | Age | Height |
---|---|---|
Alex | 23 | 178 |
Noah | 34 | 189 |
Peter | 29 | 175 |
John | 41 | 185 |
Michelle | 35 | 165 |
To extract specific information using positive indexing, follow these steps:
- Display details (the entire tuple) about Peter.
- Display John's height.
- Display Alex's age.
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 10
Challenge
Task
Swipe to show code editor
You've been provided with a tuple named people
that holds data on individuals' names, ages, and heights in the format: (('name', age, height), ('name', age, height), ...)
. Here's a snapshot of the data:
Name | Age | Height |
---|---|---|
Alex | 23 | 178 |
Noah | 34 | 189 |
Peter | 29 | 175 |
John | 41 | 185 |
Michelle | 35 | 165 |
To extract specific information using positive indexing, follow these steps:
- Display details (the entire tuple) about Peter.
- Display John's height.
- Display Alex's age.
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 10
Switch to desktop for real-world practiceContinue from where you are using one of the options below