What is my problem? I run
It's because of indentation in your function. You've put the instruction
return Max on the most inner level of your chain of
if's, so it returns result only if the maximum is
z number. When the
y is maximum it returns nothing. You can read more about python's attitude to indentation here.
def biggest(a, y, z): Max = a if y > Max: Max = y if z > Max: Max = z if y > z: Max = y return Max
If you don't need to implement your own function, you can use built-in
max function, as Mingyu pointed out.