Studying docker
at master 31 lines 802 B view raw
1print('(1) Metric (m, kg) or (2) Non-Metric (ft, pounds)?') 2 3chosen_system = input('Please choose: ') 4 5if (chosen_system != '1' and chosen_system != '2'): 6 print('You have to choose either metric or non-metric. Shutting down...') 7 exit() 8 9height_unit = 'meters' 10weight_unit = 'kilograms' 11 12if (chosen_system == '2'): 13 height_unit = 'feet' 14 weight_unit = 'pounds' 15 16print('Please enter your height in ' + height_unit) 17user_height = float(input('Your height: ')) 18 19print('Please enter your weight in ' + weight_unit) 20user_weight = float(input('Your weight: ')) 21 22adj_height = user_height 23adj_weight = user_weight 24 25if (chosen_system == '2'): 26 adj_height = user_height / 3.28084 27 adj_weight = user_weight / 2.20462 28 29bmi = adj_weight / (adj_height * adj_height) 30 31print('Your body-mass-index: ' + str(bmi))