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
tigry1 [53]
3 years ago
9

Write the function setKthDigit(n, k, d) that takes three integers -- n, k, and d -- where n is a possibly-negative int, k is a n

on-negative int, and d is a non-negative single digit (between 0 and 9 inclusive). This function returns the number n with the kth digit replaced with d. Counting starts at 0 and goes right-to-left, so the 0th digit is the rightmost digit.
Computers and Technology
1 answer:
liq [111]3 years ago
6 0

Answer:

Explanation:

Let's do this in Python, first we need to convert the number into string in order to break it into a list of character, then we can replace the kth character with d. Finally we join all characters together, convert it to integer then output it

def setKthDigit(n, k, d):

n_string = str(n)

d_char = str(d)

n_char = [c for c in n_string]

n_char[k] = d_char

new_n_string = ''.join(n_char)

return int(new_n_string)

You might be interested in
Sami needs to decide how the fonts, colors, and images will look on her new web site. Which will help her pian her design?
shtirl [24]
Maybe a sketchbook:))))
6 0
3 years ago
How did the tropica cyclone impact the environment​
Vilka [71]
Island dim disk disk dim sum
6 0
2 years ago
What are the advantages of AI?????
mr Goodwill [35]
AI is a technology that can do thing that humans are doing. So in future humans don’t have to these AI will do it for us.
4 0
4 years ago
Which components are involved with input? Output? Processing? Storage?
VMariaS [17]

Answer: Output

input keyboard mouse joystick graphics tablet trackball touchpad touchscreen microphone sensor      

Processing     processor (CPU) processor (GPU) memory motherboard

Output printer monitor touchscreen plotter speakers headphones motor data projector

Explanation:

5 0
3 years ago
Read 2 more answers
A customer wants to purchase a new home computer. The machine will mainly be used for internal browsing and streaming video, exc
Gekata [30.6K]

Answer:

Four-core processor

Explanation:

A four-core processor also known as a quad-core processor has four units cores that are independent and are responsible for reading and executing instruction in the central processing unit of a computer or system. It has high processing speed and is the best for gaming, and for multitasking purposes.

4 0
3 years ago
Other questions:
  • Which of the following criteria would not make a person eligible to receive medicare benefits?Which of the following criteria wo
    12·2 answers
  • You use the _____ sheet in the format cells dialog box to position data in a cell by centering it, for example.​
    8·1 answer
  • In 125 words describe the steps to active listening.
    6·1 answer
  • Suppose company A wants to develop a program that duplicates the functionality of a programm by company B. Describe how company
    8·1 answer
  • An app builder wants to show groups as the last navigation menu item in the Salesforce1 mobile app. However, the app builder is
    8·1 answer
  • Write a function called activity which takes an integer parameter X that does the following:
    6·1 answer
  • Look at the network topology. What will happen with the other computers if the computer breaks at the RED X?
    8·1 answer
  • Consider the following static method.
    9·1 answer
  • Which components must all tasks have? Check all that apply.
    10·1 answer
  • Fill in the Blank
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!