Challenge: Retrieving Information from Nested Tuple
Swipe to start coding
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 indexing, follow these steps:
- In the variable
peters_info, extract all the information about Peter. - In the variable
johns_height, extract John's height. - In the variable
alexs_age, extract Alex's age. - Use indexing to solve this task.
Løsning
Takk for tilbakemeldingene dine!
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Oppsummer dette kapittelet
Explain code
Explain why doesn't solve task
Awesome!
Completion rate improved to 1.67
Challenge: Retrieving Information from Nested Tuple
Sveip for å vise menyen
Swipe to start coding
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 indexing, follow these steps:
- In the variable
peters_info, extract all the information about Peter. - In the variable
johns_height, extract John's height. - In the variable
alexs_age, extract Alex's age. - Use indexing to solve this task.
Løsning
Takk for tilbakemeldingene dine!
single