There are a few mistakes in your code, for example -
te.is_empty() # Not printing anything
Obviously, you are missing a print
statement, do this -
print(te.is_empty())
And here -
for k,v in te.items():
I don't know why you are not getting an error here but it should be something like -
for k, v in te.items.items():
Why? Because your instance
contains items
that you need to iterate
with python's items
as in your __init__
, it's a dict. So essentially, modify your code to -
# for k, v in te.items.iteritems(): # python2
for k, v in te.items.items(): #python3, this is what you need
if "Available" in v:
print(k)
And your prints should work