1
Hello I’m having a problem I’m not getting Contact string to float
the program takes the price of a dps game converts to string and position through the character and I am unable to convert
price =game.find(attrs="col search_price discounted responsive_secondr
price = str(price)
if not price[110] =="<":
print("Sem Deconto:", price[101:109])
print("Com Desconto:",float(price[104:109]))
else:
print("Sem Deconto:", price[101:110])
print("Com Desconto:",price[104:110])
Upshot
File "/home/Alison/Documents/program/Steam/search_steam.py", line 57, in price
print("Discounted:"float(price[104:109]))
Valueerror: could not Convert string to float: '36,99'
I don’t know python, but I’ll give my guess: Try to convert
36.90
instead of36,99
.– Francisco
the worst that the program value returns values with 2 commas and even though 36.90 is also error
– 9 98u
Yeah, you have to turn that comma into a point, I’ll create an answer for you to see how it would look.
– Francisco