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
I am trying to figure out why I keep having the errors on the right side.
Y_Kistochka [10]

Shut down your computer and try again.

6 0
3 years ago
John has had a message pop-up on his computer asking him to pay $800 to have his files
faltersainse [42]

• Installed a program containing ransomware/malware. (Do not accept downloaded without inferring it was installed)

• Opened an email attachment containing malware.

• Opened a file containing a malicious macro.

• Left his computer unsecure allowing someone else to install malware on it. (Should include an example, e.g. not logging off)

3 0
3 years ago
Read 2 more answers
47. Which of these examples demonstrates good netiquette?
Masteriza [31]

Answer:

typing it, on a video detailing how boring and poorly made it is

Explanation:

this is an example of good netiquette because they are criticizing the video game and what good netiquette is is making a comment relevant to the original message. the original message being the video game

3 0
3 years ago
For each of the following SQL queries, for each relation involved,list the attributes that must be examined to compute the answe
Vlada [557]

Answer:

1. E.eid ,E.hobby, E.sal, E.did

2.E.eid , E.sal, E.hobby ,E.did , D.did, D.floor ,D.dname , D.budget.

3.E.eid , E.sal, E.hobby ,E.did , D.did, D.floor ,D.dname , D.budget.

4.E.eid , D.dname

Explanation:

The attributes that are examined for the query are the attributes of the table that are mentioned in the select statement and where clause.

So according to first query we are working on all attribues of Emp table so all of the attributes of Emp table are examined.In second query we selecting all attributes of both the tables hence all attributes of both the table and same in the next query.

In fourth query though the query is not complete where clause is missing but we have eid from Emp and dname from Dept tables for sure and the attributes mentioned in where clause will also be present.

7 0
3 years ago
If you are Rich In adopt me friend me And give me pets Please
Svetllana [295]

Answer:

Thanks but I don't want to give my pets there're all legendary

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • Morgan is the operations manager for a national appliance distributor. The company has offices throughout the United States. Com
    7·1 answer
  • What is unique about being an administrative professional in a government job?
    8·2 answers
  • Learning about public speaking can help improve your ________________.
    15·1 answer
  • An indirect effect of an action, be it a cost or benefit, for a third party who did not agree to the action is known as a(n) ___
    8·1 answer
  • What is a Photojournalist
    5·1 answer
  • You are developing a Windows forms application used by a government agency. You need to develop a distinct user interface elemen
    14·1 answer
  • Write at least complete set of HTML code to hyperlink to “Home.html”..
    8·1 answer
  • What is one benefit of using electronic flash cards?
    13·2 answers
  • Match the following.
    8·1 answer
  • Use the drop-down menu to complete the steps for using the Goal Seek feature.
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!