My code for the #2 problem of " Distance Between Points - 3D" is different from Codecademy’s (as provided by “View Solution”). But mine couldn’t pass.
Not sure what’s the issue…
You haven’t linked to the exercise. Is it specified in the instructions that the numbers in the lists are expected to be integers only? If the lists can have decimal numbers, then your code will give a different output than the Codecademy solution code. e.g.
If the numbers in the lists are floats, your code will produce a different output than the solution code (because you are converting the floats to ints before finding the difference between them).
a = [31.56, 54.19, 99.88]
b = [12.63, 98.54, 73.05]
# Solution code
print(distance(a,b))
# 55.182572430070714
# Your code
print(distance(a,b))
# 54.5252235208623
Yeah. I think my output was the same as Codecademy’s because the features happen to be integers. So it makes no difference with or without the int() function or not.