Posts

Showing posts from May, 2015

Coding attempt in PYTHON (bmi_calculator)

Image
This is my first attempt in python coding and tried-out to create a script in python for bmi_calculator. * create file as bmi_calculator.py * paste the below code * # python bmi_calculator.py #!/usr/bin/env python name = raw_input('Enter your Name:\t') height = input('Enter your Height "In Centimeter":\t') weight = input('shall we know your weight"In Kg":\t') he = float(height) / 100 # cm to m suwe = he * he maa = weight / suwe #print 'Name:', name #print 'Height:', height #print 'Weight:', weight ma = round(maa) print 'So, %s your BMI is:\t'  % name, ma print 'Rount of value:\t', int(ma) mx = int(ma) print 'Your Health status is:' if mx < 19:         print 'Underweight' elif mx >= 19 and mx <= 25:         print 'Normal' elif mx >= 25 and mx <= 30:         print 'Overweight' elif mx >= 30:         print 'Too Fat, kindly