Answer:
In your program the function isEmpty returns True but when you are checking the dictonary is empty or not it returns None Which is not False.
You can try out this code this may help you:
dict = {}
if len(dict) = 0
print("This directory is empty")
else:
print("This directory is in use")
you also can use equality test:
def isEmpty(Your directory name):
"""Print true if given dictionary is empty"""
if my_dict == {}:
print("Directory is empty !")
Or you can do it by using:
i = { 'x':1, 'y':2, 'z':{}}
bool(i.get('z'))
False
i['z']['e']=1
bool(i.get('z'))
True
This may help you if you still dont understand fell free to ask me any questions.
Happy Coding.