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 key way that a LAN shares
Lynna [10]

Answer:

I believe it's collaborative software

Explanation:

5 0
3 years ago
Which best describe a resource each student could use to find information
marta [7]

Online library resources

Explanation

Students can utilize online library resources from various campus available for online educational uses.In the library, information on current research in the various displines can be obtained through a search on the book, journal or document.In addition to that, goggle offers academic journals and academic documents prepared by scholars for other academicians to read and get information.

8 0
3 years ago
Read 2 more answers
Type the correct answer in the box. Spell all words correctly.
Pepsi [2]

Answer:

the diaphragm

hope it helps

6 0
3 years ago
Read 2 more answers
Please helpppppppppppppppppp please I’m stuck!
Vinvika [58]

do u know thw muffin man

3 0
3 years ago
Use the following flowchart to implement a simple application that will help students decide whether computer science is a good
marissa [1.9K]

Answer:

1.yes

2.yes

3.no

4.yes

5.yes

6.yes

7.yes

8.yes

9.yes

10.yes

Explanation:

7 0
2 years ago
Other questions:
  • ACCOUNTING
    13·2 answers
  • The ____ file permission category in unix/linux systems typically entails all permissions and is designated by the letter u.
    7·1 answer
  • Can Someone give me a 5 paragraph essay about all of the uses in Microsoft Word.
    9·1 answer
  • How major is the technology problem in the United States?
    15·1 answer
  • Select the correct answer from each drop-down menu. Look at Marta's email signature and fill in the missing elements. Marta D'Ab
    14·2 answers
  • A browser allows you to set preferences for using the browser. These preferences include all of the following except
    7·1 answer
  • 9. Which of the following is the<br>leading use of computer?​
    13·1 answer
  • What is the positional weigh of the digit 7 in the octal number 7642 ?​
    15·1 answer
  • Why does a crane need to rotate/swivel​
    9·1 answer
  • In a relational database, information is organized into tables in which each row represents a(n ) ________. Group of answer choi
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!