Hey guys im new here and im just starting out. I tried to make a BMI calculator by simply getting input and doing calculations but it doesn't work for some reason. This is the program:
print "how old are you?",
age = raw_input()
print "how tall are you?",
height = raw_input()
print "how much do you weigh?",
weight = raw_input()
print "So, you're %r years old, %r meters tall and %r Kilograms heavy.\n Ain't too bad but could be better to be honest!" %(age, height, weight)
print "Your BMI is %d" % (weight (height * height))
and this is the output:
how old are you? 1
how tall are you? 2
how much do you weigh? 4
So, you're '1' years old, '2' meters tall and '4' Kilograms heavy.
Ain't too bad but could be better to be honest!
Traceback (most recent call last):
File "ex10.py", line 11, in <module>
print "Your BMI is %d" % (weight (height * height))
TypeError: can't multiply sequence by non-int of type 'str'
Thanks guys!!!