0
name = raw_input("Hi Your Name Please:");
weight = input("What Is Your Weight:");
height = input("What Is Your Height, Answer In Metres:");

bmi = (weight/(height*height));

if bmi >= 30:
    print("Hi %s, you\'re obese."\
    " Your bmi is %d" % (name,bmi));
elif bmi >=25 and bmi < 30:
    print("Hi %s, you\'re overweight."\
    " Your bmi is %d" % (name, bmi));
elif bmi >= 18 and bmi < 25:
    print("Hi %s, you\'re ideal."\
    " Your bmi is %d" % (name, bmi));
elif bmi < 18:
    print("Hi %s, you\'re underweight."\
    " Your bmi is %d" % (name,bmi));

why doesn't this code work on wingide-101-5.1.1 Error prompted on wingide-101-5.1.1 : builtins.TypeError: can't multiply sequence by non-int of type 'str'

Seannn lim
  • 51
  • 1
  • 1
  • 3

1 Answers1

0

Try this ...

weight = float(input("What Is Your Weight:"));
height = float(input("What Is Your Height, Answer In Metres:"));
J Reid
  • 461
  • 2
  • 7