problems with Valueerror error: could not Convert string to float: in python

Asked

Viewed 1,470 times

-1

how do I convert the string to float? programa

[eero do compilador[2]

  • Please click on [Edit] and put the code as text. Putting it as an image is not ideal, understand the reasons reading the FAQ.

1 answer

1

Dude you have to make sure there is only one number string to convert. Ex

float('12.34')

This way it works normally. If there is any letter together you need to remove the letters and leave only the numbers to do the conversion. Try to debug what is returning the value you are trying to convert, if you only have numbers in string format it will work normally.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.