1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Roman55 [17]
4 years ago
15

This function takes in a string of letters separated by commas. You can # assume that the string s contains only english letters

in lower-case & # separated arbitrarily by commas. # # This function examines each string fragment that are separated by commas. # If any of the fragments contains the same letter repeated exactly MAX_DIGIT # times it returns True. Otherwise, it returns False. #
Computers and Technology
1 answer:
ololo11 [35]4 years ago
7 0

Answer:

Check the explanation

Explanation:

def has_triggers(string):

 

### split() splits the string using comma and store them in a list li

   li=string.split(",")

 

### iterate through the list and find the size of 5

   for i in range(len(li)):

     

## # if the length is > 0 and the all the 5 characters are same then returns true.

       if(len(li[i])>0 and li[i]==li[i][0]*5):

           return True

     

   return False

###calling function by passing the input string and prints the returned value

print(has_triggers('a,aaaa,aaaaa,a'))

print(has_triggers('ab,xxxxx,yxyx,m'))

print(has_triggers('ab,xx,xx,yxyx,n'))

print(has_triggers('ab,pppppppppp,qq'))

print(has_triggers(',abc,abc,abc,,,'))

You might be interested in
Terry is building a Web site and wants to have three main links called Home, Product Info, and Contact Us. She will create a hie
Shalnov [3]

Answer: Child element

Explanation:

 According to the question, terry building the web site and she wants to create the three main types of links in the home page such as home, contact us and the product information. The, she start creating the hierarchy of elements in the page and also revise all the styles in the sheet.

Then, the home page contain the two child element as it s the sub elements of the home page. As, the one element which is inherited from the upper element ( Parent ) is known as child element. This is the hierarchy of the elements which represented in the home page.  

5 0
3 years ago
Sketch f(x) = 5x2 - 20 labelling any intercepts.​
Norma-Jean [14]

Answer:

  • The graph of the function is attached below.
  • The x-intercepts will be: (2, 0), (-2, 0)
  • The y-intercept will be: (-20, 0)

Explanation:

Given the function

f\left(x\right)\:=\:5x^2-\:20

As we know that the x-intercept(s) can be obtained by setting the value y=0

so

y=\:5x^2-\:20

switching sides

5x^2-20=0

Add 20 to both sides

5x^2-20+20=0+20

5x^2=20

Dividing both sides by 5

\frac{5x^2}{5}=\frac{20}{5}

x^2=4

\mathrm{For\:}x^2=f\left(a\right)\mathrm{\:the\:solutions\:are\:}x=\sqrt{f\left(a\right)},\:\:-\sqrt{f\left(a\right)}

x=\sqrt{4},\:x=-\sqrt{4}

x=2,\:x=-2

so the x-intercepts will be: (2, 0), (-2, 0)

we also know that the y-intercept(s) can obtained by setting the value x=0

so

y=\:5(0)^2-\:20

y=0-20

y=-20

so the y-intercept will be: (-20, 0)

From the attached figure, all the intercepts are labeled.

8 0
3 years ago
Debug the program so it prints the factorial of a positive integer entered by the user. This is calculated by multiplying all th
Monica [59]

Your main problem was declaring int prod in the while loop. This caused prod to be reset back to 1 every time the while loop ran.

3 0
3 years ago
What is ‘Software Quality Assurance’?
Aleonysh [2.5K]

Answer: Software quality assurance is considered as the means under which one monitors the software processes and techniques used in order to ensure quality. The techniques using which this is attained are varied, and thus may also include ensuring accordance to more than one standards. It is referred to as a set of techniques that ensures the quality of projects in software process. These mostly include standards that administrators use in order to review and also audit software activities, i,e, these software meet standards.

5 0
3 years ago
The Internet is not a good place to connect with people when looking for a job.
djyliett [7]
This is kind of in opinion , i think it is true as people could be on the internet to kidnap or hurt others. It depends on what you think
8 0
4 years ago
Other questions:
  • [Submit on zyLabs] Please write a function with one input, a matrix, and one output, a matrix of the same size. The output matri
    10·1 answer
  • What is the wave speed of a wave that has a frequency of 100 Hz and a wavelength of 0.30m?
    5·1 answer
  • When deciding how to invest your money, which of the following is least important to know
    7·1 answer
  • A function ________ contains the statements that make up the function.
    5·1 answer
  • hen a computer user stored data in computer memory, it required 1,024 bytes. How many KB does this represent?
    8·1 answer
  • If a stop-and-wait protocol is used, what is the fraction of time, in seconds, that the sender is busy sending bits into the cha
    8·1 answer
  • Imagine you were trying to explain the Russian hacking incident to a child (around 10 years of age) and why it was unethical. Cr
    6·1 answer
  • A computer connected to the internet that ask for data is a
    15·1 answer
  • G. What are handheld computers? Write its types.​
    7·1 answer
  • In python, what is the difference between a dictionary and a set? How are they similar?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!