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
hodyreva [135]
3 years ago
9

Write a recursive function named double_digits that accepts an integer as a parameter and returns the integer obtained by replac

ing every digit with two of that digit. For example, double_digits(348) should return 334488. The call double_digits(0) should return 0. Calling your function on a negative number should return the negation of calling it on the corresponding positive number; for example, double_digits(-789) should return -778899.
Computers and Technology
1 answer:
trapecia [35]3 years ago
6 0

Answer:

A recursive function known as double-digit is a function that accepts as a parameter and returns the integer that is obtained by changing each digit with double digits. For example 425 should be return as 442255.

In the given scenario

the function will be as follow

If

def double_digits:

n < 0:

return -1 * double_digits ( -1 * n )

elif n = 0

return o

else:

result

double_digits ( n // 10 )

return int ( str ( result ) + str ( n % 10 ) + str ( n % 10 )

Test the function as follow

print ( double_digits ( 348 ) )

Result

334488

Test the function as follow

print ( double_digits ( 0 ) )

Result

0

Test the function as follow

print ( double_digits ( -789 ) )

Result

-778899

You might be interested in
Which of the following is NOT a major feature of safety and health programs? A. Assess cultural costs B. Hazard prevention and c
aleksandrvk [35]
A. assess cultural costs. they wont help anyone if they have a safety or health issue. hope this helped

8 0
3 years ago
You should hand write your references on your resume.
adelina 88 [10]
This can be taken to mean a couple of things.
Overall - no - nothing on your resume should be written in by hand. If it’s going to be included on your resume it needs to be typed in and turned in at the same time as that resume. However, it’s not unusual for people to submit their references secondary to the initial submission of their resume. In that case what you can do is list a section on your resume that’s called References and underneath state “References available by request.” If they are then requested later, turn them in typed neatly on a document that matches your resume.
4 0
3 years ago
Read 2 more answers
Carrie works on a help desk and is assigned a ticket that was automatically generated by a server because of an error. The error
OverLord2011 [107]

I would honestly say that there are a few available tools that Carrie can use, but the best tool is the inbuilt Windows Powershell. As Powershell continues to extend its purpose and usefulness, Microsoft, on the other hand, continues to use Powershell's capability to develop more cmdlets for products like Windows Servers. Everything that can be done in a GUI environment can be done in Powershell. Carrie should be able to use Powershell to run things more efficiently from the command line without stepping a foot on the physical server. She will only need to access the server from her desk remotely, run a few commands, and that is it. Powershell command line is so powerful; it carries with it every troubleshooting pack that you can think about.

5 0
3 years ago
Ejemplo la violencia no se combate con violencia
Hatshy [7]

Answer:

ur right violence should not be fought by violence

but sometimes there are problems in the world

that just happens to lead with violence

6 0
3 years ago
To move the insertion point to another location on the screen, users can use:
Nastasia [14]
By press over the location that you want using mouse
8 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following connects the processor to the chipset and memory on the motherboard? a. Thread b. FSB c. BIOS d. ALU
    9·1 answer
  • What is virtual memory?
    11·1 answer
  • What will the following program display?
    6·1 answer
  • If you're using your keyboard, what actions are you most likely performing in Access?
    15·2 answers
  • Where do you get your news? Is it owned by a large conglomerate does it matter to you who own your local news outlets? why or wh
    5·1 answer
  • Does anyone know about ICT? i need help ASAP
    9·1 answer
  • It destructs microorganisms in containers
    8·1 answer
  • B. What significant values have you learned while learning the tools and utensils?
    8·1 answer
  • Say yes if you hate edge2021?
    8·2 answers
  • at the command prompt, type ls -l myscript and press enter. what permissions does the myscript file have? next, type bash myscri
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!