Python IMC | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 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?

4th Sep 2021, 9:41 PM
Gaspar Guzman
Gaspar Guzman - avatar
4 ответов
+ 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")
4th Sep 2021, 9:52 PM
Paul K Sadler
Paul K Sadler - avatar
+ 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.
4th Sep 2021, 9:49 PM
Delorme
+ 1
Paul K Sadler tanks friend! 😁 soy nuevo en todo esto, y amo python me encantaría manejarlo para hacer ser data science
4th Sep 2021, 10:02 PM
Gaspar Guzman
Gaspar Guzman - avatar
+ 1
Guz Lindemann Que bueno amigo ¡Adelante!
4th Sep 2021, 10:04 PM
Paul K Sadler
Paul K Sadler - avatar