-
Ikenna dike started the topic How to fix invalid literal for int() with base 10 in Python? in the forum
Web Development in the group Web Development
Hello all.
Please I have challenge on an assignment. I am getting this error invalid literal for int() with base 10 while trying to run a function I created to calculate BMI. I did a code like this:
height = input("enter your height in m: ")
weight = input("enter your weight in kg: ")
h = int(height)
w = int(weight)
BMI = w/(h*h)
print(int(BMI))Please assist.
1 Comment
User Balance
H 823
/
Hopes
Sojourner
User Badges
Media
Photos
Videos
Audios
Files
Sorry, no items found.
Friends
![Profile Photo](https://hopecompass.org/wp-content/uploads/avatars/7683/1698308693-bpfull.jpg)
brazilformula
@brazilformula
![Profile Photo](https://hopecompass.org/wp-content/uploads/avatars/118/1662378214-bpfull.jpg)
Vanessa
@essa
![Profile Photo](https://hopecompass.org/wp-content/plugins/buddypress/bp-core/images/mystery-man.jpg)
Diana chloe
@diana-chloe
![Profile Photo](https://hopecompass.org/wp-content/plugins/buddypress/bp-core/images/mystery-man.jpg)
Gad Harr
@gistwheel_admin
![Profile Photo](https://hopecompass.org/wp-content/uploads/avatars/14/1717004306-bpfull.jpg)
Ozoemena
@issacozoad
@pierre-andre, @globalexperts, @issacozoad and everyone, I will appreciate your help to check what I am doing wrong.