def norep(x):
splitted = x.split()
if len(splitted) > 1: # words count
for w in set(splitted):
if splitted.count(w) == 2 and len(w) >= 6:
return False
else:
return True
else: # symbols count
splitted = list(x)
for s in set(splitted):
if splitted.count(s) == 2 and len(splitted) >= 6:
return False
else:
return True
str = 'example'
print(norep(str))
Comments
Leave a comment