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]
3 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]3 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
A client is
Vlad1618 [11]

Answer:

a computer that requests a service.

7 0
3 years ago
Read 2 more answers
Which of the following best explains the concept of a prototype
gladu [14]
A prototype<span> is an early sample, model, or release of a product built to test a </span>concept<span> or process or to act as a thing to be replicated or learned from. It is a term used in a variety of contexts, including semantics, design, electronics, and software programming.</span>
3 0
3 years ago
In the writing process, after you ve narrowed down your topic, you can use the _______ technique to view a topic from different
Veseljchak [2.6K]
It's a. when you finish your topic you can see topic from <span>different perspectives by questioning. Matching will not allow you that.</span>
8 0
3 years ago
Read 2 more answers
What happens if you never confirm your facebook account?
OleMash [197]
Nothing, it will just keep sending you annoying notifications that become more and more frequent, i would just confirm it if i were you
5 0
3 years ago
The production team for a fictional drama is shooting a key scene. One of the actors leaves out part of his scripted dialogue th
denis-greek [22]

Answer:

at last sentence was . The editor's work .

8 0
3 years ago
Read 2 more answers
Other questions:
  • A bit shift is a procedure whereby the bits in a bit string are moved to the left or to the right. For example, we can shift the
    12·1 answer
  • What is the purpose of inserting SmartArt in a Microsoft Office program? (1 point)
    11·2 answers
  • When troubleshooting a desktop motherboard, you discover the network port no longer works. What is the best and least expensive
    10·1 answer
  • what is the primary way to access applications in windows 8? a. control panel b. start menu c. desktop tiles d. context menu
    7·1 answer
  • Can a percent be used in a filename?
    13·1 answer
  • Once sales are​ forecasted, ________ must be generated to estimate required raw materials. A. a pro forma statement B. a product
    8·1 answer
  • When you save a file for the first time, you must ____.
    15·2 answers
  • For this assignment, you will write a program that calculates gross and net revenue for a movie theater. Consider the following
    15·1 answer
  • Can someone help me so I don’t fail this class:(
    14·1 answer
  • Carl is beginning a digital forensic investigation. he has been sent into the field to collect a machine. when he arrives, he se
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!