Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Calculating BMI | Strings Formatting
String Manipulation in Python
course content

Kursinhalt

String Manipulation in Python

String Manipulation in Python

1. Basic Concepts
2. String Methods
3. Strings Formatting

book
Calculating BMI

Aufgabe

Swipe to start coding

Given dictionary person with three keys: name, weight, and height. Your tasks are:

  1. Add new value to person dictionary with key bmi and value weight/height**2.
  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 a person by respective key.
  3. You need to apply .format() method to info string passing person dictionary as an argument and print the result.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 5
toggle bottom row

book
Calculating BMI

Aufgabe

Swipe to start coding

Given dictionary person with three keys: name, weight, and height. Your tasks are:

  1. Add new value to person dictionary with key bmi and value weight/height**2.
  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 a person by respective key.
  3. You need to apply .format() method to info string passing person dictionary as an argument and print the result.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 5
Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
We're sorry to hear that something went wrong. What happened?
some-alt