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
help i was building my pc and i pushed the cpu into the socket really hard until there was an audible crack and it went into the
Fed [463]
Try smashing it with a hammer, always helped me
4 0
3 years ago
Which of the following techniques is a direct benefit of using Design Patterns? Please choose all that apply Design patterns hel
Gala2k [10]

Answer:

Design patterns help you write code faster by providing a clear idea of how to implement the design

Explanation:

Design patterns help you write code faster by providing a clear idea of how to implement the design. These are basically patterns that have already be implemented by millions of dev teams all over the world and have been tested as efficient solutions to problems that tend to appear often. Using these allows you to simply focus on writing the code instead of having to spend time thinking about the problem and develop a solution. Instead, you simply follow the already developed design pattern and write the code to solve that problem that the design solves.

5 0
3 years ago
Can someone help me with python
pishuonlain [190]

Answer:

here

Explanation:

Python is an interpreted high-level general-purpose programming language. Its design philosophy emphasizes code readability with its use of significant indentation.

7 0
3 years ago
In the lungs,blood picks up carbon dioxide and releases oxygen true or false
Maksim231197 [3]

Answer:

false

Explanation:

plants do that, they absorb carbon dioxide and then they create oxygen, then humans breathe the oxygen and makes CB

8 0
3 years ago
Which of the following is your personal record of payments and bill-paying?
oksian1 [2.3K]

Answer:

I believe its a statement

Explanation:

4 0
3 years ago
Other questions:
  • What is used in computers to communicate with wireless keyboards, mice, and printers?
    8·1 answer
  • A client is asking for a printing solution that will print three sheets of paper with identical information on each page with a
    13·1 answer
  • What file system allows you to continue to add files to a CD or DVD disc after the initial burn, as long as there is room on the
    14·1 answer
  • In a company you are in charge of system maintainance. Justify with 5 reasons why your role is key
    6·1 answer
  • Which type of computer network ensures high security
    10·1 answer
  • What is the difference between the throw statement and the throws clause?
    10·1 answer
  • Which tool should be used when a fastener, such as a lug nut, is extremely tight
    6·2 answers
  • Who is Mr.Anonymous?
    5·2 answers
  • The process of sending a result back to another part of the program is
    14·1 answer
  • To generate a series of first ten counting number of algorithm​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!