+ 2
Python IMC
peso = int(52) altura = float(1.85) if peso == 52 altura == 1.85 print(underwheight) else: print(nel pasrel) Que está mal?
4 Antworten
+ 2
Guz Lindemann You need to use proper indentation in python for your if's
peso = int(52)
altura = float(1.85)
if peso == 52 and altura == 1.85:
print("underwheight")
else:
print("nel pasrel")
+ 3
In your first condition, you need to link the two comparisons ;
A colon is lacking at the end your first condition ;
There is no indentation ;
The argument in your print functions must be strings, the quotes are lacking in your code.
This won't raise an error, but you don't need to declare the type of values when assigning them to variables, as peso = int(52) is equivalent to peso = 52.
+ 1
Paul K Sadler tanks friend! 😁 soy nuevo en todo esto, y amo python me encantaría manejarlo para hacer ser data science
+ 1
Guz Lindemann Que bueno amigo ¡Adelante!