subject

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

me to correct it.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:00
The width of a piece of rectangular land is 5m shorter rhan 1/3 of its length .find the width of the land if the length is 60m,150m.
Answers: 1
question
Computers and Technology, 23.06.2019 00:00
How do we use the sumif formula (when dealing with different formats) ?
Answers: 1
question
Computers and Technology, 23.06.2019 08:00
Match the items with their respective descriptions.
Answers: 1
question
Computers and Technology, 23.06.2019 11:30
Me dangers of social media and the internetexplain what each means: 1) social media and phones have become an addiction.2) outside people have access to you all the time.3) cyberstalking4) cyberbullying5) catphishing6) viruses7) identity theft8) credit card fraud9) hacking10) money schemes
Answers: 1
You know the right answer?
Assign true to the variable has_dups if the string s1 has any duplicate character (that is if any ch...
Questions
question
Social Studies, 04.03.2021 19:40
question
Physics, 04.03.2021 19:40
question
Arts, 04.03.2021 19:40
question
Mathematics, 04.03.2021 19:40
Questions on the website: 13722359