Challenge: Converting Heights
Swipe to start coding
You've been provided with a people
list that includes sub-lists of individuals' names and their heights in centimeters. Drawing from the approach in the last chapter (iterating through the main list), you should convert each person's height from centimeters to inches by dividing by 2.54
. Then, round that number to 2
decimal places and store it in the ht_in
variable within the loop on [line 8].
Løsning
Tak for dine kommentarer!
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Awesome!
Completion rate improved to 1.64
Challenge: Converting Heights
Stryg for at vise menuen
Swipe to start coding
You've been provided with a people
list that includes sub-lists of individuals' names and their heights in centimeters. Drawing from the approach in the last chapter (iterating through the main list), you should convert each person's height from centimeters to inches by dividing by 2.54
. Then, round that number to 2
decimal places and store it in the ht_in
variable within the loop on [line 8].
Løsning
Tak for dine kommentarer!
Awesome!
Completion rate improved to 1.64single