Write a recursive function named double_digits that accepts an integer as a parameter and returns the integer obtained by replacing 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.

Answers

Answer 1

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


Related Questions

what is a Tiny Area Network?

Answers

Tiny area network is a small LAN(land area network )that only has a small nodes and is typically found in home or small office environment.

Write a program that reads a list of integers, and outputs the two smallest integers in the list, in ascending order. The input begins with an integer indicating the number of integers that follow. You can assume that the list will have at least 2 integers and fewer than 20 integers. Ex: If the input is: 5 10 5 3 21 2 the output is: 2 3 To achieve the above, first read the integers into an array. Hint: Make sure to initialize the second smallest and smallest integers properly.

Answers

Answer:

Following are the code to this question:

import java.util.*;//import package

public class Main //defining a Main class  

{

   public static void main(String[] args)//defining a main method  

   {

       Scanner oxc = new Scanner(System.in);//defining main method  

       int n,m1,m2,num,t,i;//defining integer variable

       n= oxc.nextInt();//input value from user end  

       m1 = oxc.nextInt(); //input value from user end

       m2 = oxc.nextInt(); //input value from user end

       if (m1 > m2)//defining if block that check m1 greater then m2  

       {

           //swapping the value

           t= m1;

           m1 = m2;

           m2 = t;

       }

       for (i=2;i<n;i++)//defining for loop that check the smallest value    

       {

           num = oxc.nextInt();//input value from user end

           if (num < m1) //defining if block that check num lessthan m1

           {

               m2 = m1;//store m1 value into m2  

               m1 = num;//store num value into m1

           }

           else if (num<m2)//defining else if block that check num lessthan m2

           {

               m2 = num;//store m2 value in num

           }

       }

       System.out.println(m1 + " " + m2);//print value

   }

}

Output:

5

10

5

3

21

2

2 3

Explanation:

In the above-given code, inside the main class the main method is declared, in method 6 integer variable "n,m1,m2, num,t, and i" is declared, and in the "n, m1, m2, and num" is used for input the value from the user end.

In the next step, and if block is defined that check m1 greater than m2, and swap the value.In the next step for loop s used that defines two conditions that check the two smallest value from the user input and print its value.

A company is performing an analysis on the computers at its main office. The computers are spaced along a single row. The analysis is performed in the following way: 1. Choose a contiguous segment of a certain number of computers, starting from the beginning of the row. 2. Analyze the available hard disk space on each of the computers. 3. Determine the minimum available disk space within this segment.

Answers

Answer:

array = input("Enter the list of computer memory: ").split(',')

int_arr = [int(x) for x in array]

segment = int(input("Enter the length of segment to analyze: "))

list_len = len(int_arr)

segList = []

mini = []

for x,i in enumerate(int_arr):

   seg = int_arr[i-1:segment+i-1]

   if len(seg) == segment:

       segList.append(seg)

for x in segList:

   mini.append(min(x))

result = mini.index(min(mini))

print("Segment with the minimum memory is: ",segList[result])

Explanation:

The python program prints out the segment after analysis, with the smallest disk memory space. The code gets the array of computer rows from the user input and segments the array with the number of segment input, then the minimum is compared for all segments in the network.

Write an algorithm and draw a flowchart to enter the length and width of any room then check if length and width are equal find area and circumference of the square room. Otherwise, find the area and circumference of the rectangle room.

Answers

Answer: i have no clue

Explanation:

Which retouching action is unethical?

A.

removing a person from a photograph intended for publication in a newspaper

B.

removing the saturation in a photograph intended as a magazine cover page

C.

adding extra lighting on subject’s face and body in a photograph meant for display in an exhibition

D.

changing the color of the subject’s hair in a photograph intended for use in an advertising campaign

Answers

Answer:

B.) removing the saturation in a photograph intended as a magazine cover page

Answer:

its A for Plato

Explanation:Trust me i got it right

Ryan is a manager who maintains an official record of the events that happen in his company. At the end of the day, he writes about the events that took place. The words that he frequently mentions in his record are today, client, and meeting. The moment he types the first two letter of these words, they appear as a suggestion. Which feature of the word processing program makes these suggestions

Answers

Answer: word completion

Explanation:

Answer:

Word Completion

Explanation: because i took the test.

1. Write an if statement that assigns 20 to the variable y, and assigns 40 to the variable z
2. Write an if statement that assigns 10 to the variable b, and 50 to the variable c if the
3. Write an if-else statement that assigns 0 to the variable b if the variable a is less
than 10. Otherwise, it should assign 99 to the variable b.
Has and how does it work?
Algorithm Workbench
of the variable x is greater than 100.
variable a is equal to 100.​

Answers

Answer:

if x > 100:

   y = 20

   z = 40

Explanation:

Proper answer=brainliest

Answers

Answer:

hehe

Explanation:

Which of the following apertures will give you the shallowest depth of field?
a)2.8
b)5.6
c)11
d)22
e)2
50 points and brainliest

Answers

Answer:

a.2.8

The f-stops work as inverse values, such that a small f/number (say f/2.8) corresponds to a larger or wider aperture size, which results in a shallow depth of field; conversely a large f/number (say f/16) results in a smaller or narrower aperture size and therefore a deeper depth of field.

As you draw a star, pressing the shift key while you drag increases the number of points on the star. True or false

Answers

Answer:

true

Explanation:

In 200 words or more, please describe the Cyber Security Enhancement Act. Include when it was implemented and what it's purpose is

Answers

Answer:

The summary below was written by the Congressional Research Service, which is a nonpartisan division of the Library of Congress.

12/18/2014--Public Law. (This measure has not been amended since it was passed by the Senate on December 11, 2014. The summary of that version is repeated here.)

Cybersecurity Enhancement Act of 2014 - Title I: Public-Private Collaboration on Cybersecurity - (Sec. 101) Amends the National Institute of Standards and Technology Act to permit the Secretary of Commerce, acting through the Director of the National Institute of Standards and Technology (NIST), to facilitate and support the development of a voluntary, consensus-based, industry-led set of standards and procedures to cost-effectively reduce cyber risks to critical infrastructure.

Requires the Director, in carrying out such activities, to: (1) coordinate regularly with, and incorporate the industry expertise of, relevant private sector personnel and entities, critical infrastructure owners and operators, sector coordinating councils, Information Sharing and Analysis Centers, and other relevant industry organizations; (2) consult with the heads of agencies with national security responsibilities, sector-specific agencies, state and local governments, governments of other nations, and international organizations; (3) identify a prioritized, flexible, repeatable, performance-based, and cost-effective approach, including information security measures and controls, that may be voluntarily adopted by owners and operators of critical infrastructure to help identify, assess, and manage cyber risks; and (4) include methodologies to mitigate impacts on business confidentiality, protect individual privacy and civil liberties, incorporate voluntary consensus standards and industry best practices, align with international standards, and prevent duplication of regulatory processes.

Prohibits the Director from prescribing a specific solution or requiring that products or services be designed or manufactured in a particular manner.

Prohibits information provided to NIST for purposes of developing cyber risk standards from being used by federal, state, tribal, or local agencies to regulate the activity of any entity.

Directs the Comptroller General (GAO) to submit biennial reports over a specified period concerning NIST's progress in facilitating the development of such standards and procedures. Requires such reports to address the extent to which such standards: (1) are voluntary and led by industry representatives, (2) have been promoted by federal agencies and adopted by sectors of critical infrastructure, and (3) have protected against cyber threats. Instructs the Comptroller General to include in such reports an assessment of the reasons behind decisions of sectors to adopt or not adopt such standards.

Title II: Cybersecurity Research and Development - (Sec. 201) Directs the following agencies, working through the National Science and Technology Council and the Networking and Information Technology Research and Development Program, to develop, and update every four years, a federal cybersecurity research and development strategic plan:

Explanation:

The inside color of a shape or object is it’s

Answers

Answer:

A.

Explanation:

write a function named list_total that accepts a list as an argument (assume the list contains integers) and returns the cumulative total of the values in the list

Answers

Answer:

def listSum(mylist):

  sum =0

  for item in range(0,len(mylist)):

      sum=sum+mylist[item]

  print(sum)

Explanation:

Using the Python programming language, I defined a function as listSum that accepts a list as a parameter and returns the sum of the elements in the list.

The most important logic here is defining the range of elements in the list not to exceed the length of the list using the len function. Then using a for statement, we loop through each element and add them up to a sum variable initially assigned the value of 0.

I WILL MARK BRAINLEST FOR THAT FIRST ANSWEr that is CORRECT!!!!!!!!!!!!
Which option lists the correct steps to apply a style?

1 Select the text, click the Home tab, and in the Styles Gallery, click to select a style to apply.
2 Select the text, click the Insert tab, and in the Formatting Gallery, click to select a style to apply.
3 Select the text, click the Home tab, and in the Font group, select a font, font size, and type to apply.
3 All of the options listed above are correct.

Answers

Answer:

Explanation:

Maybe all of the options listed above are correct

2or3 I would reckon hope this helps

Is it important to study information systems

Answers

Answer:

There is massive importance if you want to study information study.

It can help you understand the data, organize, and process the data, using which we can generate and share information.

Explanation:

It largely depends on your interest and requirement, but a better knowledge or clue about information systems may help analyze the data especially if you want to become a data scientist, machine learning, Artificial intelligence or deep learning, etc.

It can help you understand the data, organize, and process the data, using which we can generate and share information.

A great understanding of information systems may exponentially increase the productivity, growth, performance, and profit of the company.

Most Professions get exposed to information Systems no matter what their career objective is, as it may help in having better decision making based on the information they get through data.

So, yes!

There is a massive importance if you want to study information study.

Suppose a switch is built using a computer work station and that it can forward packets at a rate of 500,000 packets per second, regardless (within limits) of size. Assume the workstation uses direct memory access (DMA) to move data in and out of its main memory, which has a bandwidth of 2 Gbps, and that the I/O bus has a bandwidth of 1 Gbps. At what packet size would the bus bandwidth become the limiting factor

Answers

Answer:

When the transmission exceeds 667 packets

Explanation:

In computer networking, a packet is a chunk of data transmitted across the network. The packet size of an Ethernet network is 1.5kilobytes, while the packet size of an IP packet payload is 64 kilobytes.

A switch is a physical network device that connects nodes or workstations while communicating the packets (or frames). The I/O bus size bandwidth is 1Gbps which allows approximately 667 packets. Once this packet size is crossed, the bus becomes a limiting factor or bottle neck.

4.8 Code Practice: Question 1
I need help

Answers

for x in range(5,76,5):

   print(x, end=" ")

I wrote my code in python 3.8. Hope this helps

Name the application used for creating Presentations___
1.MS PowerPoint
2.MS Word
3MS Excel

Answers

Keynote is great for presentation

Answer:

1.MS PowerPoint

This is similar to the last problem, except that the first number on a line is an ID number that identifies an account. The same ID number may appear on any number of lines. Use a Dictionary to accumulate, for each ID, the sum of all the numbers that are on all the lines with that ID number. Call the input file id_data.txt. Write an output file called ID_sums.txt. On each line of the output fille, print an ID number and the sum. Sort the lines by the numerical order of the IDs

Answers

Answer:

Following are the code to this question:

def getSum(ID):#defining a method getSum that accept an ID

   t= 0#defining a variable t

   while ID!= 0:#defining while loop to check ID not equal to 0

       t+= ID % 10# holding remainder value

       ID = ID // 10#holding quotient value

   return t#return total value

def readRecord(S):#defining a method readRecord that hold list  

   f_Read = open("idInfo.txt","r")#defining a variable f_Read to open file

   for C_ID in f_Read:#defining for loop to hold file value  

       C_ID = C_ID.replace('\n', '')#use replace method

       S[C_ID] = getSum(int(C_ID))#use list to method value

   f_Read.close()#close file

def sortRecord(ID_List, t_List):#defining a sortRecord

   for x in range(len(ID_List) - 1):#defining for loop to calculate the length of list  

       for y in range(0, len(ID_List) - x - 1):#defining for loop to calculate the length of list

           if ID_List[y] > ID_List[y+1]:#defining if block to check value is greater

               ID_List[y], ID_List[y+1] = ID_List[y+1], ID_List[y]#swap the value

               t_List[y], t_List[y+1] = t_List[y+1], t_List[y]#swap the value

def showReport(ID, t):#defining a method showReport that accept id and t

   for i in range(len(ID)):#defining for loop to hold index value

       print(ID[i]," ",t[i])#print index value

def writeRecord(ID_List, t_List):#defining a method writeRecord that accept two list

   f_Write = open("idSorted.txt","w")#defining a variable f_Write to hold store value in file

   for i in range(len(ID_List)):#defining a for loop to store value with index

       f_Write.write(ID_List[i])#hold list value

       f_Write.write(" ")    #for space

       f_Write.write(str(t_List[i]) + "\n")# add index value

   f_Write.close()#close file

def run():#defining method run

   S = {}#defining an empty list

   readRecord(S)#passing list into readRecord method

   ID_List = list(S.keys())#defining a variable that holds key value in list

   t_List = list(S.values())#defining a variable that holds values value in list

   sortRecord(ID_List, t_List)#calling a method sortRecord by passing value

   showReport(ID_List, t_List)#calling a method showReport by passing value

   writeRecord(ID_List, t_List)#calling a method writeRecord by passing value

if "run":

   run()

Output:

Please find the attached file.

Explanation:

In the above program code, 6 method getSum, readRecord, sortRecord,showReport, writeRecord, and run method is defined, in which getSum and readRecord is used a single list store value in parameters, and in other methods, it accepts two parameter to store value in key and values form and use a txt file to store and take value.    

In the run method, an empty list s is declared, that pass into the variable ID_List and t_List, and call the method, in this program two a text file "idInfo.txt" is used, that holds some value in the file, and create another file that is "idSorted.txt", in this file it stores the value in the numerical order of the ID's.

You already know how to use lists. What is the index of 5 in the following list? [2, 3, 5, 1, 6]

Answers

Answer:

it's 2

Explanation:

it goes 0, 1, 2.

The index of 5 in the following list [2, 3, 5, 1, 6] is 2. The correct option is b.

What is a list in computer language?

A list is a collection of items that can be ordered or unordered. Adding, removing, and storing items are just a few of the many uses for lists. However, the software needs adequate memory to keep up with changes made to the list in order for the programmer to do the various duties for the list.

An ordered group of values is a list. The components of a list are referred to as its elements or items. An ordered list of numbers (or other items like geometric objects) is referred to as a sequence, and it frequently follows a certain pattern or function.

A list is a series of different variables that are all gathered under one common name. Rather than creating a program with numerous variables,

Therefore, the correct option is b, 2.

To learn more about the list, refer to the link:

https://brainly.com/question/14297987

#SPJ2

The question is incomplete. Your most probably complete question is given below:

O 4

02

O 1

03

Page
U what is a common language that computers use
to talk with one another on- a network?
a. client b. Adapter
c. protocol d. operating
System​

Answers

I think it’s protocol
The computers use a set of protocols. Therefore, the answer is C. Protocol. I hope this helps.

Which Excel function or tool will you use to display the cells that are referred to by a formula in the selected cell

Answers

Answer:

Trace Precedent

Explanation:

Trace Precedent is a Microsoft Excel tool that is mostly used in auditing work to evaluate the connection or linkage between the cells in a spreadsheet. It is used to display the cells that are referred to by a formula in the selected cell. This is to locate the basis of an error in knowing how the formulas are adapted.

This can be done by clicking on the Formulas tab, then click on Formulas Auditing, then click on Trace Precedents.

Hence, in this case, the correct answer is TRACE PRECEDENTS.

PLS HELP ME!! WILL GIVE BRAINLIEST

Read the following block of CSS code, and then answer the question.


body

{

position: relative;

left: 50px;

top: 50px;

}


What effect would this code have on the display of a box?

All content would be placed 50 pixels to the left of the current box.

The current box would be located 50 pixels to the left of the page border.

The current box would be located 50 pixels to the left of the next page element.

The current box would be located 50 pixels to the left of the first textual element.

Answers

B i think sorry if I’m wrong

Answer:

it is maybe:

A.  All content would be placed 50 pixels to the left of the current box.

Explanation:

The quality of an image is compromised when, what are stretched ?​

Answers

Answer:

pixels

Explanation:

The quality of an image is compromised when pixels are stretched the answer would be stretched.

What is resolution?

The number of unique pixels that may be displayed in each dimension depends on the display resolution or display modes of a digital television, computer monitor, or display device.

As we know,

The smallest component on your screen is a pixel. Resolution: The size of the pixel is discussed here.

The resolution increases with pixel size. Although strictly a printing word, DPI (or dots per inch) refers to the number of actual ink dots on a printed object.

When pixels are stretched, an image's quality suffers.

Thus, the quality of an image is compromised when pixels are stretched the answer would be stretched.

Learn more about the resolution here:

https://brainly.com/question/989447

#SPJ6

Exodia
Principle of Computer Operation​

Answers

Answer:

????

Explanation:

David bought 5.2 pounds of oranges for $1.20 per pound . how much did david spend ..................................................... explain to me how you did it

Answers

Answer:

David spent $6.24.

Explanation:

5.2 times 1.2

You need to update your router settings, so you log into the administration panel, Whose Internet protocol (IP) address is 192.168.0.1. which IP version is this?

A-IPv4
B-IPv2
C-IPv6
D-IPv1

Answers

Answer:

D

Explanation:

Review how to write a for loop by choosing the output of this short program.

for counter in range(3):
print(counter * 2)


Please explain it to me, I’m not learning Bc I don’t have a teacher.

Answers

Answer:

The output is:

0

2

4

Explanation:

First of all, the print statement must be indented with a tab, otherwise it is not part of the for loop.

The range(3) creates an array with values 0,1,2. The variable 'counter' gets those values one after another, and the print statement outputs this value doubled, hence the 0, 2 and 4 output.

Most slide layouts include at least one ________ by default.
Question 2 options:

placeholder

action button

transition

animation

Answers

Hey

I think that the answer placeholder :)

Sry if im wrong tho

Answer:

The answer is placeholder.

Below is an ERD showing the 1:M relationship between Department and Employee entity types. This relationship is modeled as a Department JSON object as:Department: deptID,deptName,deptRoom,{deptPhone},{employee: empID, empName,empPhone,{empEmail}}Where {} indicates multi-valued.Part 1: Open the mydb database we created earlier and create a new department table with two fields:documentid (as an integer field) Jsondocument (as a JSON field)And add around 3 departments and each with 2 or 3 employees.Part 2: Use SQL to answer the following questions:Q1: Select all the records in the table.Q2: List the department names with their phones.Q3: A query to show the deptName and number of employees of the department.Q4: A query to show all the employees of a department of your choice using deptName as criteria.USE MYSQL

Answers

Answer:

hi

Explanation:

Other Questions
What caused the us opinion to be against germany? Label the parts of the diagram using key terms from the lesson. Look at the pictures below. What type of arch, vault, or dome is each? A) An ornate building with a large dome that is almost a complete circle. It tapers at the very top. B) A large room with repeating vaults in the ceiling. C) A dome with several windows along the rim. D) A doorway with an arch made of horizontal bricks. Please help im dumb iufrjvg What does the little 3 in 2NH3 mean? A circle has a diameter of 8 cm. What is its circumference?Use 3.14 for a, and do not round your answer. Be sure to include the correct unit in your answer. The demand for Titos Tacos increased so much that Tito has decided to increase his prices by 10%. Write a single term expression that represents the new price of one of Titos Tacos if the original price was t dollars whats 0.1 as a percent What animal eats snakes [tex]Read[/tex] if the recessive allele for cystic fibrosis is represented as c help pleaseee!!!!!!! will give brainliest !!!!!How do you increase the number of CPUs in a virtual machine in order to optimize it? It is 5:15 pm now. What time will it be in 40 minutes?5:45 amA5:45 pmc5:55 pm6:00 pm 6.Which of the following is an advantage for organisms living in dense populations?ADisease spreads slowlyB. There is little competition for resources.C.Dense population increase in size rapidly.D. It is easier to find a mate for reproduction. Pls help me with this! Thank u !! Fiteen packs of fruit snacks cost $3. How much do 5 paxks of fruit snack cost? Which statement below best describes what a ratio is. A . A comparisonB. A comparison of many things C.A numberD. A comparison of two quantities using diwasion What is the distance between point A and point B? Round to nearest tenth. Please stat Brainlist who ever answers first OR! Who ever answers with a fluent explanation. Please solve it for me because I am stuck. If you had a chance to protest something, what would it be, and how would you protest You are standing on a moving bus, facing forward, and you suddenly fall forward. You can imply form this that the buss