Question regarding 18/19 and data types [possible bug]


#1

In 18/19 I wrote this code, yes it could be much much simpler, but this is fancier or something I guess.

import math

def root(input):
output = math.sqrt(input)
print output

input = 13689
input = float(input)
root(input)

Which outputs 117**.0**. I'd like it to output an integer, but when I used

print int(output)

it doesn't pass the exercise. It outputs 117 just fine, but the exercise doesn't pass.

Why does this happen? Is it just because the exercise needs a float to pass, or is it something to do with the math module? It makes me input float(input) because it only takes floats (returns an error otherwise) so it might be because it's just a little finicky with data types. Probably the exercise though, in which case uh idk yeah. Can anyone tell me with certainty?


#2

Dont use "input" as a integer value, since "input" can also be seen as a command.


#3

Oh right, good point. However I'm now using df (something random) as an argument and it's still the same thing (http://puu.sh/kZLEN/5b9304cd1a.png)