Web Analytics

Assign True to the variable has_dups if the string s1 has any duplicate character (that is if any character appears more than once) and False otherwise.




Here is the answer I wrote:



i = []

for i in range(len([s1])):

if s1.count(s1[i]) > 1:

has_dups = True

elif s1.count(s1[i]) = 1:

has_dups = False



Here is the message I got from the system:


Solutions with your approach don't usually use: elif




Please Help me to correct it.