# int() function broken?

I have an input that I turn into an integer for some math stuff, but when I put in a decimal, it comes out with an error:

ValueError: Invalid literal for int() with base 10: '1.75'

johnj

now python seems to think that 500 isn't less than 10000.

put in 10000 in the first input, 500 in the third, and any numbers in the other two.

the final output should be more than 1, but it's not.

my code:

a = input('linear start num: ')

b = input('linear increase num: ')

c = input('exponential start num: ')

d = input('exponential increase num: ')

num = 1

print('\n\n\n')

while c < a:

num += 1

a = float(a) + float(b)

c = float(c) * float(d)

print(num)

https://repl.it/@johnj/Fixing-the-mind-numbing-monotony-of-algebra

Please Help!

AllAwesome497

@johnj If exponential increase is supposed to be the exponent (c^d) then u did (c*d)

johnj

@AllAwesome497 no, it's supposed to be multiplication.

johnj

thanks

You would have to use

`float()`

. An integer is a whole number, so it cannot have a decimal point, and the`int()`

would not work. And by the way,`int()`

is not actually a function. It is a class, pre-defined by python.Thanks for the help and the quick reply.

`int()`

can be negative too ;)