+ 1
can you help me to spot the error?
i have written a code and i am stuck on an error .plz help. the code : https://code.sololearn.com/c23gBVJG8r32 the error: Traceback (most recent call last): File "file0.py", line 5, in <module> bmi = weight_kg // height_m * height_m TypeError: unsupported operand type(s) for //: 'str' and 'str'
6 Answers
+ 2
Looks like your code is big enough. So please post it in the code playground and attach the code with a description.If you don't know how to do it then you can have a look at it:
https://www.sololearn.com/post/75089/?ref=app
+ 1
height_m and weight_kg needs to be converted to integers for them to divide, as you can't divide strings with each other.
To convert these variables you need to include the int() function. Like the following:
height_m = int(input())
weight_kg = int(input())
+ 1
okay thanks a lot to both of you
0
oh okay HrCoder
0
done
0
damanistopme on
height_m = input()
weight_kg = input()
Use
height_m =int( input())
weight_kg = int(input())
because input() === string