I’m using below code but it only works in some case but not others (e.g. is_unique(heythere)).
what’s the issue with it?
how should it be revised to work? thanks in advance.
def is_unique(input_str):
d = dict()
for i in input_str:
if i in dict():
d[i]+=1
else:
d[i]=1
return all(value == 1 for value in d.values())
Course: Educative: Interactive Courses for Software Developers
Lesson: Educative: Interactive Courses for Software Developers