Aug-09-2020, 03:39 PM
I have two questions.
First: I want to multiply two variables, but I get an error. How can I solve it?
here is my Code:
Like that: "Random is overweight"
Hope, you can help me. Here is a smiley for you
First: I want to multiply two variables, but I get an error. How can I solve it?
here is my Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
Name = 'Random' Height = 1 , 65 Weight = 52 bmi = Weight / (Height * Height) print ( 'Name: ' ) print (Name) print ( 'BMI: ' ) print (bmi) print (Name) if bmi < 25 : print ( 'is underweight' ) elif bmi > 25 : print ( 'is overweight' ) elif bmi = = 25 : print ( 'is normal-weight' ) |
Error:Traceback (most recent call last):
File "D:/Python Scripts/if-Abfrage Testen.py", line 4, in <module>
bmi = Weight / (Height * Height)
TypeError: can't multiply sequence by non-int of type 'tuple'
My second question: How can I make, that it prints the name of the person and the type of weigh it has in one line? Like that: "Random is overweight"
Hope, you can help me. Here is a smiley for you
