GH avatar Bite 56. Add a command line interface to our BMI calculator

Complete create_parser below so that our BMI program can be called like this:

$ python -h
usage: [-h] [-w WEIGHT] [-l LENGTH]

Calculate your BMI.

optional arguments:
  -h, --help            show this help message and exit
  -w WEIGHT, --weight WEIGHT
                        Your weight in kg
  -l LENGTH, --length LENGTH
                        Your length in cm

$ python -w 80 -l 187
Your BMI is: 22.88

Please note that calc_bmi and handle_args are given, you only need to code create_parser!

We have two more Bites to practice argparse: 57 and 58.

99 out of 102 users completed this Bite.
Will you be Pythonista #100 to crack this Bite?
It takes an average of ~60 minutes to solve this Bite (submissions 5-240 min).
Pythonistas rate this Bite 4.43 on a 1-10 difficulty scale.
» Up for a challenge? 💪

Buy Now Login and get coding
We use Python 3.7