Calculating BMI
Oppgave
Swipe to start coding
Given dictionary person with three keys: name, weight, and height. Your tasks are:
- Add new value to
persondictionary with keybmiand valueweight/height**2. - Create pattern named
info"name weight is weight kg, height is height m. BMI is bmi". Everything there written in italics is the value of apersonby respective key. - You need to apply
.format()method toinfostring passingpersondictionary as an argument and print the result.
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 3. Kapittel 5
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
Suggested prompts:
Oppsummer dette kapittelet
Explain code
Explain why doesn't solve task
Awesome!
Completion rate improved to 4.35
Calculating BMI
Sveip for å vise menyen
Oppgave
Swipe to start coding
Given dictionary person with three keys: name, weight, and height. Your tasks are:
- Add new value to
persondictionary with keybmiand valueweight/height**2. - Create pattern named
info"name weight is weight kg, height is height m. BMI is bmi". Everything there written in italics is the value of apersonby respective key. - You need to apply
.format()method toinfostring passingpersondictionary as an argument and print the result.
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 3. Kapittel 5
single