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, 23.06.2019 06:00
What machine listens for http requests to come in to a website’s domain? a. a router b. a browser c. a server d. a uniform resource locator
Answers: 1
question
Computers and Technology, 23.06.2019 08:30
Helen's credit card has an apr of 15.32% and a grace period of 17 days and helen pays her balance in the full every month. if her last billing cycle ended on september 26, 2009, and she made her payment on october 11, 2009, did she owe any interest on her last statement's balance?
Answers: 3
question
Computers and Technology, 24.06.2019 13:00
If you add the following to the query grid in an access query, what is it called? salestaxamt: [salestaxrate]*[totalsale] formula calculated field total calculation
Answers: 2
question
Computers and Technology, 24.06.2019 16:00
To fill (copy) a cell across or down, point to the of the cell and drag. top left corner top right corner bottom left corner bottom right corner
Answers: 3
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
Computers and Technology, 08.06.2020 18:57
question
Mathematics, 08.06.2020 18:57
question
Mathematics, 08.06.2020 18:57