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
serious [3.7K]
3 years ago
8

write a function insert_string_multiple_times() that has four arguments: a string, an index into the string, a string to insert,

and a count. the function will return a string with count copies of the insert-string inserted starting at the index. note: you should only write the function. do not put any statements outside of the function. examples: insert_string_multiple_times('123456789',3,'xy',3) '123xyxyxy456789' insert_string_multiple_times('helloworld',5,'.',4) 'hello....world' insert_string_multiple_times('abc',0,'a',2) 'aaabc' insert_string_multiple_times('abc',0,'a',0) 'abc'
Computers and Technology
1 answer:
padilas [110]3 years ago
5 0

Answer:

Written in Python:

def insert_string_multiple_times(str1,indto,str2,count):

   splitstr = str1[:indto]

   for i in range(count):

       splitstr+=str2

       

   splitstr +=str1[indto:]

   print(splitstr)

Explanation:

This line defines the method

def insert_string_multiple_times(str1,indto,str2,count):

In the above definition:

<em>str1 represents the string</em>

<em>indto represents index to insert a new string</em>

<em>str2 represents the new string to insert</em>

<em>count represents the number of times str2 is to be inserted</em>

This gets the substring from the beginning to indto - 1

   splitstr = str1[:indto]

This performs an iterative operation

   for i in range(count):

This appends str2 to the first part of the separated string

       splitstr+=str2

This appends the remaining part of the separated string        

   splitstr +=str1[indto:]

This prints the new string

   print(splitstr)

You might be interested in
To give your app users the ability to open your app directly from other apps by clicking a link, you should use:.
pickupchik [31]
<span>To give your app users the ability to open your app directly from other apps by clicking a link, you should use:  deep link. With the deep link and its URL functionality, existing app users are driven directly inside the mobile app itself. 
</span>Deep links are usually made up of two parts: a scheme (part of the link that identifies which app to open).<span>and a </span>host and path (<span>the unique location in the app where your content exists).</span>

7 0
3 years ago
(TCO B) The symbol shown as a three-sided box that is connected to the step it references by a dashed line is what?
xxTIMURxx [149]

Answer:

Annotation symbol.

Explanation:

A flowchart can be defined as a graphical representation of an algorithm for a process or workflow.

Basically, a flowchart make use of standard symbols such as arrows, rectangle, diamond and an oval to graphically represent the steps associated with a system, process or workflow sequentially i.e from the beginning (start) to the end (finish).

A symbol shown as a three-sided box in a flowchart, that is connected to the step it references by a dashed line is known as an annotation symbol.

This ultimately implies that, it provides additional information in the form of remarks or comments with respect to the steps in a flowchart.

8 0
3 years ago
Which is NOT something that a game producer needs to do?
3241004551 [841]

Answer:

Plan the script, characters, and how the game is played

6 0
3 years ago
Which of the following rules should be used to keep the appropriate distance between your vehicle and the vehicle in front of yo
S_A_V [24]
I would say two car length rule. I am not sure what the official license rule is or if it has been changed, but originally the rule was 3 seconds usually depending on how fast the car is going. The faster you are going, the longer it takes to stop. So two-car length rule would probably be the best choice. Definitely not A.
8 0
4 years ago
Read 2 more answers
Select the correct answer.
sveticcg [70]

Answer:

D

Explanation:

5 0
4 years ago
Read 2 more answers
Other questions:
  • A defined set of standards that computers must follow in order to communicate properly is known as a
    13·2 answers
  • A bitmap picture can be represented by hexadecimal numbers. Each two-digit hexadecimal number represents a row. To convert a num
    14·1 answer
  • Which of the following journals is not aimed at the public as well as scientists?
    7·1 answer
  • I'm 11, except my profile says I'm 15.
    15·1 answer
  • You have developed a prototype of a software system and your manager is very impressed by it. She proposes that it should be put
    5·1 answer
  • In 2009, __________ accounted for 1,772 total fatalities. A. passengers riding with impaired drivers B. children hit by backing
    14·2 answers
  • The minimum spanning tree of an undirected graph G exists if and only if G is connected. True or False?
    12·1 answer
  • . What is the difference between a combinational circuit and sequential circuit? Give example of each.
    8·1 answer
  • Which of the following helps you plan out every step of an animation?
    12·2 answers
  • Why is it important for organizations to make strong commitment to Cloud at scale?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!