А
Size: a a a
А
R3
R3
А
sorted(array, key=lambda x: x==0 and not isinstance(x, bool))
А
R3
БГ
isinstance(x, bool)
🌚👌АА
isinstance(x, bool)
🌚👌БГ
return sorted(array, key=lambda x: x==0 and isinstance (x, (inf,float)))
А
return sorted(array, key=lambda x: x==0 and isinstance (x, (inf,float)))
БГ
py3
help(isinstance)
Help on built-in function isinstance in module builtins:
isinstance(obj, class_or_tuple, /)
Return whether an object is an instance of a class or of a subclass thereof.
A tuple, as in ``isinstance(x, (A, B, ...))``, may be given as the target to
check against. This is equivalent to ``isinstance(x, A) or isinstance(x, B)
or ...`` etc.
БГ
АА
return sorted(array, key=lambda x: x==0 and isinstance (x, (inf,float)))
БГ
А
return sorted(array, key=lambda x: x==0 and isinstance (x, (inf,float)))
x is 0 or x is 0.0
)БГ
АА
БГ
АА