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
The information of an management information system comes from?
Debora [2.8K]

A management information system is a computer system consisting of hardware and software that serves as the backbone of an organization's operations

5 0
2 years ago
Write an expression using membership operators that prints "Special number" if special_num is one of the special numbers stored
Mashcka [7]

Answer:

In python, the statement can be written as:

<em>if(special_num in special_list): print("Special Number") </em>

Explanation:

We need to create a list with the name 'special_list' with some values and then check whether special_num is in the list or not using the membership operator.

Membership operator in python: <em>in</em>

Let us do it step by step in python:

<em>special_list = ['1', '2', '3','4']      #</em>A list with the values 1, 2, 3 and 4

<em>special_num = input("Enter the number to be checked as special \t") </em>

<em>#</em>Taking the input from the user in the variable special_num.

<em>if(special_num </em><em>in</em><em> special_list): print("Special Number") </em>

#Using the membership operator <em>in </em>to check whether it exists in the list or not.

Please refer to the image attached for the execution of above program.

So, the answer is:

In python, the statement can be written as:

<em>if(special_num in special_list): print("Special Number") </em>

6 0
4 years ago
All of the following are advantages of database-stored information, except: Question 3 options: 1) Reduced information redundanc
enot [183]

Answer:

3) Reduced information integrity.

Explanation:

This is not an advantage, Information integrity is a key factor when storing information on a database. As multiple users will access it, they will need this data to be authentic and dependable. Any reduction in information integrity is a great disadvantage.

5 0
3 years ago
What is the term for water wave that is created by an underwater earthquake
Mashutka [201]
A tsunami/tidal wave is a huge wave caused by an earthquake.
7 0
3 years ago
Assume that the ciphertext C is computed from the plaintext P by C= P ⊕ K1 ⊕ K2 , where K1 and K2 are the encryption key and ⊕ d
Sedbober [7]

Answer:

K1 ⊕ K2 = 9

Explanation:

Since 5 ⊕ K = 12, K must be 5 ⊕ 12 = 9.

But there are supposedly two encryptionkeys, we cannot know their individual value, only that K1 ⊕ K2 = 9.

That makes this a bit weird question.

4 0
4 years ago
Other questions:
  • Which of the following is a disadvantage of using a personality assessment to determine who is well suited for a work position?
    7·2 answers
  • Which agricultural CTSO has programs for middle-school and high-school students, as well as college students?
    13·2 answers
  • The most commonly used traffic control devices used in road construction and maintenance work areas are
    10·1 answer
  • Tristan has successfully deleted the blank row. The next thing he wants to do is to increase the length of the first column. A 2
    13·2 answers
  • WILL GIVE BRAINLIEST!!!!!!!!
    6·1 answer
  • Which of the following statements are true regarding Steve Jobs and Steve Wozniak? Select 3 options.
    5·2 answers
  • What is the most likely result of a correctly installed processor, but an incorrectly installed cooler?
    6·1 answer
  • Que significa DESFRAGMENTAR EL DISCO DURO?????
    14·1 answer
  • 1. What type of malware is triggered by a specific condition, such as a specific date or a particular user account being disable
    6·1 answer
  • The method "someOtherMethod" is NOT defined as static. This means...
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!