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
Write a function max_magnitude() with two integer input parameters that returns the largest magnitude value. Use the function in
storchak [24]

I wrote my code in python 3.8:

def max_magnitude(num1, num2):

   return num1 if abs(num1) > abs(num2) else num2

print(max_magnitude(-8,-2))

I hope this helps!

4 0
3 years ago
Which item can be added to Outlook messages, like a Word document or PowerPoint presentation, that takes standard bulleted lists
Sonja [21]

Answer:

WordArt

Explanation:

Took exam

4 0
2 years ago
Please help I’ll give brainleistt
iren2701 [21]

Answer:

7. B

8. A

9. B

10. B

11. A

Explanation:

6 0
2 years ago
Pseudoscience is
madreJ [45]
C is going to be your answer 
6 0
3 years ago
Read 2 more answers
What describes a group of cells?<br> O crowd<br> Orange<br> O set<br> gangle
deff fn [24]

Answer:

A crowd because it makes more sense tho i could be wrong

7 0
3 years ago
Read 2 more answers
Other questions:
  • _____ allow(s) a user to double click with the mouse in a document to move the insertion point to a new location.
    11·1 answer
  • What are you guys doing?
    13·2 answers
  • An example of live footage is when?
    10·2 answers
  • What is the purpose of an arraignment?
    9·2 answers
  • What is WEB 1.0 to WEB3.0
    11·1 answer
  • Write the algorithm for finding the perimeter of a rectangle using English like form step by step
    10·1 answer
  • Is spin to win paying or is a scam app​
    6·2 answers
  • Help plz!! I will mark brainliest
    15·2 answers
  • What are node in a computer network​
    14·1 answer
  • De acuerdo con las generaciones de la computación, ¿Creen que estamos en la 5ta generación o aun no? y ¿por qué?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!