Ask coding questions

← Back to all posts
Need help with a value errors
syflexer (460)

so i am not very used to working with lots of numbers and i am making a program for my grampa so he can calculate his electricity bill and split it amung the house hold easier but i am having a error on line 70 with converting the bill amount from a str to a int the bill number i am using t0 test is 157.54 but i am getting a value error that i dont know how to fix

Answered by CodingCactus (4188) [earned 5 cycles]
View Answer
CodingCactus (4188)

an int is a whole number, when you input a decimal number, it will error if you put it into an int, so instead of bill=int(bill) do bill=float(bill)
and for all the others as well that you want decimal values for