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
A tower or mini tower pc is a type of all- in -one unit true or false
Svetlanka [38]

Answer:

thx

Explanation:

5 0
3 years ago
Read 2 more answers
User-system interaction is?
Mandarinka [93]
A multidisciplinary, post-Master<span> educational program which provides practical training in the field of </span>human-computer interaction and user interface design<span>.</span>
8 0
3 years ago
Electricity was seen as a mysterious force and began to creat a stir when people called​
atroni [7]

This isn't related to computers and when you look it up all it comes up with a Stars Wars.

3 0
3 years ago
How many pieces are there in a normal laptop??? Good luck and solve carefully
polet [3.4K]

What do you mean pieces? Like Laptop components? If so then motherboard,ram,cpu, and psu for a basic laptop so 4 I guess (5 if you want to include a gpu).

4 0
3 years ago
Tuesday
4vir4ik [10]

Answer:

?

Explanation:

these are instructions to a question?

7 0
2 years ago
Other questions:
  • Is Apple a consumer or luxury brand? Give examples.
    10·1 answer
  • What is the last step in planning your budget
    11·1 answer
  • Liz's meeting is scheduled to end at 9:30. It is 9:20 and team
    9·1 answer
  • Which one of the following statements is correct? a. Web browsers cannot function without cookies. b. Cookies are text files and
    9·1 answer
  • Biomimicry is the term used when engineers are inspired by objects found in nature? Group of answer choices True False
    10·1 answer
  • The famous study entitled ""Protection Analysis: Final Report"" focused on a project undertaken by ARPA to understand and detect
    14·1 answer
  • Courses that enable students to begin jobs that require course completion certificates are know as
    8·1 answer
  • The physical part or components of a computer system called​
    5·2 answers
  • Why bootable installer preparation is important? explain
    9·1 answer
  • Why isn't image display working on wacom tablet.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!