You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
347 B
Python
15 lines
347 B
Python
9 months ago
|
def findMinAndMax(L):
|
||
|
return (None, None)
|
||
|
|
||
|
|
||
|
if findMinAndMax([]) != (None, None):
|
||
|
print('测试失败!')
|
||
|
elif findMinAndMax([7]) != (7, 7):
|
||
|
print('测试失败!')
|
||
|
elif findMinAndMax([7, 1]) != (1, 7):
|
||
|
print('测试失败!')
|
||
|
elif findMinAndMax([7, 1, 3, 9, 5]) != (1, 9):
|
||
|
print('测试失败!')
|
||
|
else:
|
||
|
print('测试成功!')
|