Ok so im an absolut beginner at this and trying Coderslang in Visual Studio.How do i get the highest number from ..._result? It allways just gives me the first one.
first_result = max_of_three(1, -1, 3)print(first_result)second_result = max_of_three(1, 4, 2)print(second_result)third_result = max_of_three(1, 2, 2)print(third_result)I tried:
def max_of_three(x, y, z): max = x if y > max: max = y if z > max: max = z return maxfirst_result = max_of_three(1, -1, 3)print(first_result)second_result = max_of_three(1, 4, 2)print(second_result)third_result = max_of_three(1, 2, 2)print(third_result)Result:
3
None
None