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
This provides an easy method for workers to use their computers. FAT FAT RAM RAM DOS DOS GUI
Maurinko [17]
C: GUI or Graphical User Interface.
A: Dos is an operating system (MS Dos)
B Fat is a file format for drives
D: Ram is one of the many things that makes a computer work
4 0
2 years ago
Swiping up with three fingers on mac os x launches what?
iVinArrow [24]
It opens and closes mission control
7 0
3 years ago
Write an algorithm to display your name 10 times​
Tasya [4]

Hey this code was made in java if you have any issues let me know

package nametest;

public class Nametest {

   

   public static void main(String[] args) {

       System.out.println("namehere");

        System.out.println("namehere");

         System.out.println("namehere");

          System.out.println("namehere");

           System.out.println("namehere");

            System.out.println("namehere");

             System.out.println("namehere");

              System.out.println("namehere");

               System.out.println("namehere");

                System.out.println("namehere");

       

   }

   

}

Hope it helps

-scav

4 0
3 years ago
The third wave of computing was characterized by the introduction of _____.
MrRissso [65]

Answer:

personal computers

Explanation:

The third wave of computing was characterized by the introduction of <u>personal computers </u>

4 0
3 years ago
You have created a new dhcp scope with address range 192.168.1.1 to 192.168.1.254. you have five servers configured with static
galben [10]
Reduce the scope to <span>192.168.1.1 .. 192.168.1.239, to avoid conflicting IP's.</span>
6 0
3 years ago
Other questions:
  • Which of the following is a Microsoft solution that runs on a Microsoft Terminal Services server but appears, to end users, as i
    10·1 answer
  • Some drive letters, such as the letter ____ that is typically used with the primary hard drive, are usually consistent from comp
    9·1 answer
  • How much a 1 Gigabyte in Bytes:<br> 1. 1e+9<br> 2. 1e+6<br> 3. 1000
    8·2 answers
  • PLZ HELP ME! What is a false statement about online time?
    9·1 answer
  • Write a program in c++ that asks the user for a sequence of n​integers, where the user provides the number of elements n​ then e
    12·1 answer
  • What is the best way to locate where my C program gets into an infinite loop
    5·1 answer
  • I want to solve this question in C program, Please.
    7·1 answer
  • If Anyone can help me out that'll be great
    11·1 answer
  • When writing a function or a formula in a spreadsheet,what is the first u should do​
    5·1 answer
  • ____ uses a computer to design and test new products and modify existing ones. Computer-aided manufacturing Just-in-time design
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!