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
Ethics in Al can contribute toward social progress and boost positive changes in society. Which aspect should be removed to achi
ivolga24 [154]

Answer: Hayaa~!

The answer is: . c. bias

Is known when someone purposefully biased an answer towards what they belive or think, this can be avoided by not asking them about topics that we firmly believe they are biased.

Explanation: I took the test

Hope this Helps

-Aaden<3

3 0
2 years ago
Given: int[][] values = new int[4][5] Using the statement above, write a nested loop to set values as follows: (3 pts) [0] [1] [
marshall27 [118]

Answer:

The question is a bit unclear. Are you asking how to add these values in this 2D array?

Explanation:

8 0
3 years ago
Which function can NOT be performed using the Conditional Formatting option?
Liono4ka [1.6K]

Answer:D is the answer to this one

5 0
3 years ago
Read 2 more answers
A que generacion pertenecen los gadgets?
alukav5142 [94]

Answer:

English please

Explanation:

8 0
2 years ago
How long is the ap computer science principles exam
slava [35]

Answer: The exam is 2 hours long.

Explanation:

8 0
2 years ago
Read 2 more answers
Other questions:
  • PLEASE HELP ASAP!!!!
    14·1 answer
  • A program that coaches you at each step in the process is said to have a(n)
    12·2 answers
  • Indexed sequential access, an index is more useful when the number of record is
    10·1 answer
  • What is the base for a hexadecimal number system?
    11·1 answer
  • The keywords used in programming languages that use decisions to redirect the flow of a program are called __
    13·1 answer
  • Mike has never used a slide software before, but he needs to create a presentation by the end of the week. what recourse would b
    8·1 answer
  • HELP ME PLEASE ASAP
    6·1 answer
  • Which of the following is NOT one of the three main ways to control a program when writing code?
    6·2 answers
  • Why people shouldnt get married​
    6·1 answer
  • Dominic list his camera for sale on an online auction site Chloe is the highest bitter and purchase as the camera how does the a
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!