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 19:30
When creating a presentation in libre office impress, where does the editing of slides take place?
Answers: 1
question
Computers and Technology, 23.06.2019 20:10
Leo is a recruitment executive for a large company. he has identified new labor resource requirements in both the marketing and production departments. what should be his first step in recruiting candidates for the positions? a. conduct background checks of candidates b. make job offers c. arrange interviews d. conduct reference checks e. place job ads on job sites
Answers: 1
question
Computers and Technology, 24.06.2019 08:00
Java the manager of a football stadium wants you to write a program that calculates the total ticket sales after each game
Answers: 1
question
Computers and Technology, 24.06.2019 11:40
100 pts. first person gets brainliest
Answers: 2
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
English, 06.11.2020 18:50
question
Mathematics, 06.11.2020 18:50
question
English, 06.11.2020 18:50
question
Law, 06.11.2020 18:50
question
English, 06.11.2020 18:50
Questions on the website: 13722367