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
steposvetlana [31]
2 years ago
5

Write a function named replace_at_index that takes a string and an integer. The function should return a new string that is the

same as the old string, EXCEPT with a dash in place of whatever character was at the index indicated by the integer. Call your function on the word eggplant and the index 3
Computers and Technology
1 answer:
aalyn [17]2 years ago
4 0

Answer:

def replace_at_index(str, number):

   new = str.replace(str[number], "-")

   return new

print(replace_at_index("eggplant", 3))

Explanation:

- Create a function called <em>replace_at_index</em> that takes a string and an integer

- Initialize a new variable called <em>new</em>, that will hold the new string

- Replace the character at given index with dash using <em>replace</em> function, it takes two parameters: the first is the character we want to replace, the second is the new character.

- Return the new string

- Call the function with the required inputs

You might be interested in
You are creating a budget for your new business.What should you include
aev [14]

Answer:

When operating a business, your budget will need to be created to account for fixed and variable costs. Fixed costs include your rent, utilities, phone/ Internet, accountant, legal fees, technology, salaries, advertising & marketing. Variable costs include the costs of goods sold and labor costs/ commissions.

Explanation:

5 0
3 years ago
Fill in the blank with the correct response.<br> A submenu in a text editor is indicated by a <br> .
igomit [66]

Answer:

triangle

Explanation:

7 0
2 years ago
PLEASE HELP I WILL REWARD YOU
xxMikexx [17]
What what what what what what
5 0
3 years ago
Type the correct answer in the box. Use numerals instead of words. If necessary, use / for the fraction bar. What will be the ou
lord [1]

Answer:

2

Explanation:

The output of the Java program is 2. The public Vehicle class is defined with the class variable 'counter'. When a Vehicle class object is instantiated, the counter variable increments by one.

In the program, the two instances of the class are created, incrementing the counter variable to two, the print statement outputs 2 as the result of the program.

8 0
2 years ago
What is one difference between a web page and a web application?
saul85 [17]

Answer:

A website is a group of globally accessible, interlinked web pages which have a single domain name. A web application is a software or program which is accessible using any web browser. Developing your website helps you in branding your business.

8 0
2 years ago
Other questions:
  • What device brocasts all data packets to other nodes on a network?
    5·1 answer
  • Sarah, a computer user, tells James, a computer technician, that the network she is connected to is running too slowly. Which of
    5·1 answer
  • What is a GUI?
    11·1 answer
  • Convert each of the following base 10 &amp; base 2 numbers in signed magnitude, one’s complement and two’s complement. Each of t
    8·1 answer
  • Name an analog quantity other than temperature and sound
    13·1 answer
  • Using direct mapping, consider a 16-bit memory addresses, and a cache with 64 blocks, where each block is 8 bytes. What is the s
    8·1 answer
  • Which online article citation is correctly formatted according to MLA standards?
    15·2 answers
  • What aspect should you consider before adding pictures to a document?
    6·1 answer
  • Animals living in burrows under the ground is an interaction between the biosphere and the
    11·1 answer
  • State the base of correct addition of 27 + 6 =34​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!