def findMinAndMax(L):
if len(L)== 0:
return None,None
for i in L:
if not isinstance(i,(int,float)):
continue
else:
max ,min = i,i
break
for i in range(len(L)):
if not isinstance(L[i],(int,float)):
print(L[i] + " is not int or float type")
elif L[i] > max:
max = L[i]
elif L[i] < min:
min = L[i]
return max,min
Sign in to make a reply
def findMinAndMax(L):
if len(L)== 0:
return None,None
for i in L:
if not isinstance(i,(int,float)):
continue
else:
max ,min = i,i
break
for i in range(len(L)):
if not isinstance(L[i],(int,float)):
print(L[i] + " is not int or float type")
continue
elif L[i] > max:
max = L[i]
elif L[i] < min:
min = L[i]
return max,min