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
The computer program that Josh is working on presents him with a sentence in which a word has been underlined. Josh has to indic
Phantasy [73]

Answer:

Drill and Practice

Explanation:

<em>Drill and Practice</em> is a type of Computer-based Instruction (CBI) program. In <em>Drill and Practice</em>, answered questions are given immediate feedback. These problems or exercises are structured and answered on the program to provide instant feedback to the person taking the test.

<em>For instance</em>, when going through an evaluation test but you are required to provide the correct answer before moving on. Once a question is answered, the program will indicate whether correct or wrong, if the question is correct, move to the next question but if wrong you start again. This is a typical example of Drill and practice.

This is exactly what is seen in our scenario in the question.

4 0
3 years ago
Tgif
VMariaS [17]
Science and mathematics. STEM can also be engineering but in John’s case, he’s a METEOROLOGIST WHO DOES THE WEATHER FORECAST and meteorologists is part of a study in science and also mathematics because of measuring the speed of some related computations
6 0
3 years ago
You use lpstat and determine that a user named User1 has placed two large print jobs in the queue for Printer1 that have yet to
ICE Princess25 [194]

A command that should be used to remove these two print jobs from the print queue is cancel Printer1-17 Printer1-21.

<h3>What is printing?</h3>

Printing can be defined as a process that typically involves sending print jobs from a computer system to a printer, especially through the print queue.

In Computer technology, "cancel Printer1-17 Printer1-21" is a command that should be used to remove the two (2) print jobs from the print queue of Printer1 which is yet to start printing.

Read more on printer here: brainly.com/question/17100575

#SPJ1

6 0
2 years ago
Which of the following is a template definition?
musickatia [10]

Answer:

b. template<classT>.

Explanation:

Template functions are that can work with generic types. Template lets us to create a function so that more than 1 type or class can adapt  the functionality of that function.

We can write the template function as following:-

template<class typename>.

It matches to the option b.

5 0
3 years ago
Need deveolpers not software
ivolga24 [154]
Developers? For what?
3 0
4 years ago
Read 2 more answers
Other questions:
  • Write a program that calculates an adult's fat-burning heart rate, which is 70% of 220 minus the person's age. Complete fat_burn
    10·1 answer
  • Esther has acquired an associate's degree in information technology and certifications in PageMaker and Illustrator. Which caree
    8·2 answers
  • Which of the following is NOT an example of input?
    8·1 answer
  • Explain how the principles underlying agile methods lead to accelerated development and deployment of software.
    6·1 answer
  • Which principle of CSR requires that a business state facts fully and accurately?
    8·1 answer
  • How should you set the OHMS ADJust control on a multitester of analog VOM, for resistance measurements?
    12·1 answer
  • Question #8
    13·1 answer
  • 12. Why is it so important to pay attention to your digital reputation?
    14·1 answer
  • 8. Which of the following is an output device
    14·1 answer
  • 2. Which one of the following is the purpose of relating tables in a database?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!