+ 3
Why this gives me syntax error?
print("||Wellcome To Python||") str = input("Weight and Hieght") a,b = str.split(' ') print('Your BMI is',int(a) / ((int(b))**2)) int(a) = int(a) / (int(b)**2 if (a > 25) print("Fat!") elif (a > 20 & a < 25) print("Good!") elif (a < 20) print("Thin!") input("Press Space to finish...")
2 Answers
+ 1
If statements in python don't require parentheses, but do require a colon after the statement declaration:
if a > 25 :
print("Fat")
+ 3
thank you very much!