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
Vlada [557]
3 years ago
15

7.2.7: Part 1, Replace a Letter

Computers and Technology
2 answers:
Elza [17]3 years ago
4 0

def replace_at_index(txt, ind):

   new_txt = ""

   for x in range(len(txt)):

       if x == ind:

           new_txt += "-"

       else:

           new_txt += txt[x]

   return new_txt

print(replace_at_index("eggplant", 3))

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

umka21 [38]3 years ago
3 0

Answer:

def replace_at_index(string, index):

   return string[0:index]+"-"+string[index+1:]

   

replaced_word = replace_at_index("house", 0)

print(replaced_word)

Explanation:

Simpler version

You might be interested in
Bao bì chủ động active packaging và bao bì thông minh intelligent packaging khác biệt như thế nào
Zielflug [23.3K]

answer:

yes....................

3 0
3 years ago
Which command on the page layout ribbon enables a user to mark where a new page will begin on the printed copy?
tatiyna
The page break is the command on the page layout ribbon enables a user to mark where a new page will begin on the printed copy
3 0
3 years ago
How do i add a header or footer to powerpoint presentation
BartSMP [9]
When you have you presentation open, go to Insert > Header & Footer.

7 0
4 years ago
My mom works from home selling her craft work online to people all over the world. She can do this from home because we have acc
8_murik_8 [283]
I would go with A) The Internet 


I hope that turns out well for you. Good luck! (:
6 0
3 years ago
There are three managerial skills listed that a good administrative medical assistant (MAA) should prosses
Yuliya22 [10]
Ask for detalls follow report
5 0
3 years ago
Other questions:
  • Tim is in charge of the upcoming interschool baketball tournamnent. He wants to arrange all of the teams and their members in al
    15·1 answer
  • Can I recover my data from HDD if I just started formatting but did not finish it? (I ceased it!)
    7·1 answer
  • Which name is given to a set of communications standards for simultaneous digital transmission of voice, video, data, and other
    6·1 answer
  • When it comes to safety, the choice to be safe is often up to __________?
    8·1 answer
  • Mike's boss told him he needs to be more efficient. Select each suggestion that will help him become more efficient at creating
    9·1 answer
  • You have three users who travel to four branch offices often and need to log on to the RODCs at these offices. The branch office
    12·1 answer
  • True or False: Assuming that all variables are defined, the following segment of code is invalid. if ( x > 0 )
    10·1 answer
  • 52. Which of the following numbering system is used by the computer to display numbers? A. Binary B. Octal C. Decimal D. Hexadec
    12·2 answers
  • While using a web-based order form, an attacker enters an unusually large value in the Quantity field. The value he or she enter
    15·1 answer
  • a company recently implemented a secure sockets layer/transport layer security (ssl/tls) version that supports secure hashing al
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!