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
Explain briely what this statement mean.<br>"A byte is equivalent to a character"<br>​
dedylja [7]

To put it briefly, a byte is equivalent to a <em>character</em> in that it encodes a single character, being this in the form of a<u> letter, number, or symbol.</u>

A byte is the smallest unit of storage memory on any modern computer. This byte is commonly made up of<u> eight bits</u>, a combination of binary digits used to represent data. The hierarchy of computer memory is as follows:

  • 1 byte
  • 1 kilobyte
  • 1 megabyte
  • 1 gigabyte
  • 1 terabyte

The statement "<em>A byte is equivalent to a character</em>" is quite literal in its meaning given that through the use of the bits that comprise it, a byte is used to represent and store the data for a single character of text, being that a <u>letter, number or at times a symbol.</u>

<u />

To learn more:

brainly.com/question/13188094?referrer=searchResults

3 0
3 years ago
The reader can tell from the Article that __________.
Dmitry_Shevchenko [17]

Answer:

D. NASA would have preferred that the process for making trajectory calculations during the 1930s and 1940s had not been brought to light.

7 0
3 years ago
Which ie tab is used to configure how to manage cookies?
Virty [35]
Hmm I think it's the favorite bar
4 0
3 years ago
In spreadsheets, a cell reference is also referred to as which of the following? A. active cell B. axis C. cell address D. entry
nignag [31]
Generally its referring to the cells location, so C.
4 0
3 years ago
Attention merchants define
Marina CMI [18]

Answer:

A merchant is a person who buys or sells goods in large quantities, especially one who imports and exports them.

4 0
3 years ago
Other questions:
  • Mutual authentication for multiple services is also known as _______.
    12·1 answer
  • Fundamental types of data, such as strings, integers, and real numbers, are known as
    5·1 answer
  • Describe conductors and insulators in terms of energy
    11·1 answer
  • Using encryption, a sender can encrypt a message by translating it to which of the following?
    15·1 answer
  • What section in an ethernet frame will you find a Virtual Local Area Network (VLAN) header?
    6·1 answer
  • javascript Write a program to calculate the credit card balance after one year if a person only pays the minimum monthly payment
    7·1 answer
  • Need the answer for this code hs will give brainly
    7·1 answer
  • All programs display a list of all the installed programs​
    9·1 answer
  • Item 3
    15·1 answer
  • What is responsible for recording an image of an object with camera <br> Pls I neeed it right know
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!