How to convert a list of strings to string and check for duplicate characters with Python

1 Answer

0 votes
def haseDuplicate(s):
     return len(s) != len(set(s))
     
lst = ["c", "python", "php", "java", "c++"] 

s = ''.join(str(e) for e in lst)    

print(haseDuplicate(s))

    

'''
run:

True

'''

 



answered May 20, 2023 by avibootz
...