2016-10-26 20 views
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)); 

はなぜwingide-101-5.1.1 エラーにこのコードの動作はwingide-101-5.1.1にプロンプ​​トが表示されません:builtins.TypeErrorは:の非整数でシーケンスを乗算することはできません型 'str' はシステム組み込み関数のエラー

答えて

0

は...これを試してみてください

weight = float(input("What Is Your Weight:")); 
height = float(input("What Is Your Height, Answer In Metres:")); 
関連する問題