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
IOS jail broken or Android unrooted which is better to hack with
Ira Lisetskai [31]
IOS Jail Broken - that is more advanced then an android
3 0
3 years ago
Which if the following is an effect of intellectual property theft?
Leno4ka [110]
Record companies lose money because people download songs for free.
8 0
3 years ago
Read 2 more answers
Clarifying and developing our personal values involves a number of steps including critical thinking
Grace [21]
True. I think we should trust ourselves and interaction with someone including teachers, classmates and parents...We must be developing our critical thinking skills.
8 0
4 years ago
I need help figuring out 2 pictures with topics that I can put on a magazine about the serengeti. This is something I'm doing fo
Usimov [2.4K]

Answer:

how about lions, trees, or zebras

Explanation:

i looked it up

4 0
3 years ago
Read 2 more answers
Private BLANK are cloud services available to members of a particular organization.
dalvyx [7]

Answer:

A private cloud is a set of applications and resources that are available only to individuals within a specific organization. These resources may be owned by the organization itself or by a third party, and may be hosted inside or outside

Explanation:

.

4 0
3 years ago
Other questions:
  • Give a big-O estimate for the number of comparisons used by the algorithm that determines the number of 1s in a bit string of le
    9·2 answers
  • business ethics chapter 7 jordan, a software engineer, is responsible for maintaining the private piece of his company's interne
    15·1 answer
  • Sending an email to customer support before looking through the site and reading the frequently asked questions is an example of
    5·1 answer
  • If num is an int which expression always evaluates to true if num holds an odd number
    15·1 answer
  • Which statement gives an advantage of multicellular organisms?
    7·2 answers
  • Find the smallest value of n such that LCM of n is 15 is 45​
    5·1 answer
  • What is your definition of Digital Safety?
    6·1 answer
  • What are the different types database of end users? Discuss the main activi-ties of each
    6·2 answers
  • Task queues, which allow for asynchronous performance, are an important part of modern processing architectures. Information abo
    13·1 answer
  • An Accenture healthcare client is interested in implementing an Artificial Intelligence (AI) solution to improve patient care, b
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!