ahmet / Python-for-Data-Science
Herkese Açık Ahmet Kerem Piscine Final
NULL_not_found.py 687 B
def NULL_not_found(object: any) -> int:
"""Print the value and type of any kind of "Null".
Return 0 when the object is a known "Null", 1 otherwise.
"""
if object is None:
print(f"Nothing: {object} {type(object)}")
elif isinstance(object, float) and object != object:
print(f"Cheese: {object} {type(object)}")
elif type(object) is bool:
print(f"Fake: {object} {type(object)}")
elif type(object) is int and object == 0:
print(f"Zero: {object} {type(object)}")
elif type(object) is str and object == "":
print(f"Empty: {object} {type(object)}")
else:
print("Type not Found")
return 1
return 0