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
Which file system is designed to verify and autocorrect data faults on the volume without having to bring the volume down for ma
Aloiza [94]

Answer: ReFS or Resilient File System.

The ReFS system was actually built from the NTFS (New Technology File System). The ReFS has similar features, but also comes with a built-in scanning system. The ReFS constantly checks your data constantly for corrupted data. The ReFS also supports larger volumes of drives and can support up to 32,768 characters.

6 0
3 years ago
Why is know app downloading in my android phone even if I have 900 MB ???
Mamont248 [21]

Answer:

May be you have not signed in with Google

8 0
3 years ago
Read 2 more answers
Write a program that: Takes the list lotsOfNumbers and uses a loop to find the sum of all of the odd numbers in the list (hint:
Alika [10]

Answer:

Following are the code to this question:

#include <iostream>//defining header file

using namespace std;

int main()//defining main method

{

int x[]={2,3,4,6,7,8,9,1,11,12};//defining 1-D array and assign value

int i,sum=0;//defining integer variable

for(i=0;i<10;i++)//defining loop for count value

{

   if(x[i]%2==1)//defining if block to check odd value

   {

       sum=sum+x[i];//add value in sum variable

   }

}

cout<<sum;//print sum

return 0;

}

Output:

31

Explanation:

In the above-given program, an integer array "x" is declared that holds some integer values, and in the next line two integer variable "i and sum" is defined which is used to calculate the value.

In the next line, a for loop is declared, that counts all array value, and it uses the if block to check the odd value and add all the value into the sum variable.

5 0
3 years ago
The fastest way to get help is to type a word or two in the search box.
Elanso [62]
The fastest way to get help is to type a word or two in the search box. TRUE.
5 0
4 years ago
Write a class called point that represents a point in 2d plane.
USPshnik [31]

In this way, writing the code in C++ we can say that it will be possible to make the coordinates on the planes.

<h3>Writing the code we have:</h3>

<em>#include <iostream></em>

<em>#include <cmath></em>

<em>#include <iomanip></em>

<em>using namespace std;</em>

<em>class Point{</em>

<em>private:</em>

<em>float x;</em>

<em>float y;</em>

<em>public:</em>

<em>Point(){ </em>

<em>x = y = 0;</em>

<em>}</em>

<em>Point(float x, float y){ </em>

<em>this->x = x;</em>

<em>this->y = y;</em>

<em>}</em>

<em>float getX(){ </em>

<em>return x;</em>

<em>}</em>

<em>float getY(){</em>

<em>return y;</em>

<em>}</em>

<em>float getDistance(){</em>

<em>return math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2));</em>

<em>}</em>

<em>string toString(){ </em>

<em>return "("(x1, y)","(x2, y2)")";</em>

<em>}</em>

<em>};</em>

See more about C code at brainly.com/question/17544466

#SPJ1

7 0
3 years ago
Other questions:
  • The one place where c++ allows aggregate operations on arrays is the input and output of c-strings.
    8·1 answer
  • When you are printing handouts, which of these can you do? A. Save paper by placing more than one slide per page. B. Check the f
    7·1 answer
  • Marissa, a 21-year-old young woman, is working as an intern at a software company. She has recently graduated from college. She
    6·1 answer
  • A packet analyzer is a program that can enable a hacker to do all of the following EXCEPT ________. Select one: A. assume your i
    6·1 answer
  • What language must be used to display a bare-minimum webpage?
    8·2 answers
  • package dataStructures; /** * Class OrderedLinkedList. * * This class functions as a linked list, but ensures items are stored i
    8·1 answer
  • Menus are attached to the windows by calling
    15·1 answer
  • Hey everyone. I am so bored
    14·2 answers
  • A researcher is interested in learning more about the different kinds of plants growing in different areas of the state she live
    8·1 answer
  • ASAP 50 POINTS
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!