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 18:50
What is transmission control protocol/internet protocol (tcp/ip)? software that prevents direct communication between a sending and receiving computer and is used to monitor packets for security reasons a standard that specifies the format of data as well as the rules to be followed during transmission a simple network protocol that allows the transfer of files between two computers on the internet a standard internet protocol that provides the technical foundation for the public internet as well as for large numbers of private networks
Answers: 2
question
Computers and Technology, 23.06.2019 19:30
2. fluorine and chlorine molecules are blamed fora trapping the sun's energyob forming acid rainoc producing smogod destroying ozone molecules
Answers: 2
question
Computers and Technology, 23.06.2019 22:30
Jamie has to enter the names, employee id’s, and income of a group of employees into a worksheet. which option will jamie use to describe the data
Answers: 3
question
Computers and Technology, 24.06.2019 00:30
Setting up a home network using wireless connections is creating a a. vpn b. lan c. wan d. mini-internet
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
Mathematics, 31.03.2021 01:40
question
Chemistry, 31.03.2021 01:40
question
Biology, 31.03.2021 01:40
question
Mathematics, 31.03.2021 01:40
question
Spanish, 31.03.2021 01:40
question
Mathematics, 31.03.2021 01:40
question
Mathematics, 31.03.2021 01:40
Questions on the website: 13722363