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
nataly862011 [7]
3 years ago
14

7.2.8: Part 2, Replace a Letter

Computers and Technology
1 answer:
Archy [21]3 years ago
7 0

def replace_at_index(txt, ind, let):

   new_txt = ""

   for x in range(len(txt)):

       if x == ind:

           new_txt += let

       else:

           new_txt += txt[x]

   return new_txt

print(replace_at_index(input("Enter a word or phrase: "), int(input("Enter an index value: ")), input("Enter the new letter: ")))

I wrote my code in python 3.8. I hope this helps.

You might be interested in
g Write a function named vowels that has one parameter and will return two values. Here is how the function works: Use a while l
lianna [129]
10-20-100.40 = my bin =nice
5 0
3 years ago
How to identify mistakes in a html code??​
Over [174]
hello i am having a mental breakdown could u help me please?
7 0
3 years ago
Tell me at list 5 farm animals dieases​
Vlad [161]
<h3>Answer : </h3>

<em><u>F</u></em><em><u>a</u></em><em><u>r</u></em><em><u>m</u></em><em><u> </u></em><em><u>C</u></em><em><u>o</u></em><em><u>m</u></em><em><u>m</u></em><em><u>o</u></em><em><u>n</u></em><em><u> </u></em><em><u>D</u></em><em><u>i</u></em><em><u>s</u></em><em><u>e</u></em><em><u>a</u></em><em><u>s</u></em><em><u>e</u></em><em><u>s</u></em><em><u> </u></em><em><u>:</u></em><em><u> </u></em>

<em><u>.</u></em><em><u> </u></em><em><u>General Farm Animal Diseases.</u></em>

<em><u>.</u></em><em><u> </u></em><em><u>Avian Influenza.</u></em>

<em><u>.</u></em><em><u> </u></em><em><u>Bovine Spongiform Encephalopathy (BSE)</u></em>

<em><u>.</u></em><em><u> </u></em><em><u>Foot-and-Mouth Disease.</u></em>

<em><u>.</u></em><em><u> </u></em><em><u>West Nile Virus.</u></em>

Explanation:

<em><u>H</u></em><em><u>o</u></em><em><u>p</u></em><em><u>e</u></em><em><u> </u></em><em><u>i</u></em><em><u>t</u></em><em><u> </u></em><em><u>h</u></em><em><u>e</u></em><em><u>l</u></em><em><u>p</u></em><em><u>s</u></em><em><u> </u></em><em><u>o</u></em><em><u>u</u></em><em><u>t</u></em><em><u> </u></em><em><u>:</u></em><em><u>)</u></em><em><u>)</u></em>

7 0
3 years ago
Read 2 more answers
What are your thoughts on copyright?<br><br> (Write 2 or more sentences)
victus00 [196]

Answer:

I look down on copyright. To take someone else's work and disguising it as your own seems like a form of theft.

5 0
3 years ago
Read 2 more answers
1. Briefly explain the concept of signature of a function, in a function declaration. What signature components are crucial for
Irina18 [472]

Answer:

Function signature can be defined as a combined term used to refer to the function name, function return type, no of arguments , type of arguments.

Explanation:

The signature of function is seen as a combined term used to refer to the function name, function return type, number of arguments , type of arguments.

When overloaded functions is been defined, they are different in numbet of arguments or type of argument passed.

To understand this better refer to the program code below.

C++ code.

#include <iostream>

using namespace std;

int multiply(int a, int b)

{

cout << a*b <<endl;

return 0;

}

int multiply(int a, int b, int c)

{

cout << a*b*c <<endl;

return 0;

}

int main()

{

//function with two arguments passed

multiply(3, 50);

//function with three arguments passed . It is different in number of arguments passed. Thus here function signature is different

multiply(4, 20, 10);

}

6 0
3 years ago
Other questions:
  • Fill the validateForm function to check that the phone number contains a number (use the isNaN function) and that the user name
    10·1 answer
  • Jessica finds out that the government introduced a new trade policy that will increase import tariffs. She calls for a meeting o
    15·1 answer
  • Which of the following is not considered format?
    8·2 answers
  • A technician has been given a PC that is not powering up. After brief troubleshooting, the technician comes to the conclusion th
    14·1 answer
  • lance has three tables in his database. He wants to generate a report to show data from the three tables. Therefore, he decides
    7·2 answers
  • - Which amongst the following is not a Characteristic of Cloud Computing?
    5·1 answer
  • Primary functions of lighting are sufficient light to...
    13·1 answer
  • Which of the following statement is correct ? A . potential difference is measured by ammeter . B . The unit of potential differ
    9·1 answer
  • Difference between a port and a connector
    10·1 answer
  • Software that converts program written in other language into machine language​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!