Imagine that Python works in a function call ( calculateDistance(2, 4, 6, 8) ), evaluating the function and literally just replacing the line of code calculateDistance(2, 4, 6, 8) number returned by the function, say 7 .
Thus, typing calculateDistance(2, 4, 6, 8) in a line by itself will do the same as typing 7 in a line by itself. You need to do something with this value, for example, store it in a variable
dist = calculateDistance(2, 4, 6, 8)
or just print it immediately
print calculateDistance(2, 4, 6, 8)
source share