Can anybody help me. my question is in the code comments. I want to check if the generator items is empty.
name = 'john'
while True:
n = (x for x in names if x['name'] == name) #generator
if len(n) != 0: #this is wrong obviously. But this is what I want to do with the generator items.
break
name = input('Enter name > ')