Thanks for reaching out to us. In python dict() function is a constructor which creates a dictionary. In “if” condition you have written “if i in dict()” => to check whether a letter is already present in dictionary or not (but here dictionary is created in every iteration as you have used dict() function instead of dictionary name “d” ). It will always get false and will go to else condition. So try changing it to " if i in d:" instead of “if i in dict()”. Try the following code.
d = dict()
for i in input_str:
if i in d:
return all(value == 1 for value in d.values())