我绝对是这方面的初学者,并在Visual Studio中try Coderslang. 如何从._获得最高号码结果?它总是只给我第一个.
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)
我try 过:
def max_of_three(x, y, z):
max = x
if y > max:
max = y
if z > max:
max = z
return max
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)
结果:
3
None
None