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
SashulF [63]
3 years ago
9

Use python

Computers and Technology
1 answer:
Degger [83]3 years ago
3 0

Answer:

def rec_dig_sum( num ):

   num_list = [ digit for digit in str(num)]

   total = 0

   for x in num_list:

       total += x

   return total

def dict_of_rec_dig_sums(low, high):

   mydict = dict()

   for number in the range(low, high+1):

      mydict[rec_dig_sum(number)] = number

   return mydict

Explanation:

The python program defines two functions, "rec_dig_sum" and "dict_of_rec_dig_sums". The former accepts a number and returns the sum of the digits of the number while the latter accepts a low and high number range.

The program returns a dictionary with the recursive sum as the keys and the number count as the values.

You might be interested in
Which is true about SSH and Telnet?
MaRussiya [10]

Answer:

Data is encrypted on SSH

Explanation:

Telnet and SSH both are the networking protocols. These protocol are used for the security of data. In telnet data is sent over the link without any encryption. That is the reason, in telnet protocol data is less secure.

In SSH (Security Shell) protocol data has been encrypted before transmission. The encryption of data make it more secure between transmitter and receiver.

So the true statement is that, SSH has data encryption.

8 0
3 years ago
Betty is applying for a software analyst role. which field should she specialize in? information technology resource management
Schach [20]
Since Betty is applying for a software analyst role, she should specialize in INFORMATION TECHNOLOGY.

<span>Information technology or IT is defined as the study or use of systems in computers and telecommunications for storing, retrieving, and sending information.
</span>
Betty's role as a software analyst  would be to:
1) <span> study the </span>software<span> application domain,
2) prepare </span>software<span> requirements and specification (</span>Software<span> Requirements Specification) documents.
3) be the link between the software users and software developers.</span>
5 0
3 years ago
Read 2 more answers
At which layer of the osi model is the entire message referred to as the payload
erik [133]

I guess the correct answer is application

An applicatiοn layеr is an abstractiοn layеr that spеcifiеs thе sharеd cοmmunicatiοns prοtοcοls and intеrfacе mеthοds usеd by hοsts in a cοmmunicatiοns nеtwοrk. Thе applicatiοn layеr abstractiοn is usеd in bοth οf thе standard mοdеls οf cοmputеr nеtwοrking: thе Intеrnеt Prοtοcοl Suitе (TCP/IP) and thе ΟSI mοdеl. Althοugh bοth mοdеls usе thе samе tеrm fοr thеir rеspеctivе highеst lеvеl layеr, thе dеtailеd dеfinitiοns and purpοsеs arе diffеrеnt.

6 0
3 years ago
Write a python program to read four numbers (representing the four octets of an IP) and print the next five IP addresses. Be sur
sdas [7]

Answer:

first_octet = int(input("Enter the first octet: "))

second_octet = int(input("Enter the second octet: "))

third_octet = int(input("Enter the third octet: "))

forth_octet = int(input("Enter the forth octet: "))

octet_start = forth_octet + 1

octet_end = forth_octet + 6

if (1 <= first_octet <= 255) and (0 <= second_octet <= 255) and (0 <= third_octet <= 255) and (0 <= forth_octet <= 255):

   for ip in range(octet_start, octet_end):

       forth_octet = forth_octet + 1

       if forth_octet > 255:

           forth_octet = (forth_octet % 255) - 1

           third_octet = third_octet + 1

           if third_octet > 255:

               third_octet = (third_octet % 255) - 1

               second_octet = second_octet + 1

               if second_octet > 255:

                   second_octet = (second_octet % 255) - 1

                   first_octet = first_octet + 1

                   if first_octet > 255:

                       print("No more available IP!")

                       break

       print(str(first_octet) + "." + str(second_octet) + "." + str(third_octet) + "." + str(forth_octet))

else:

   print("Invalid input!")

Explanation:

- Ask the user for the octets

- Initialize the start and end points of the loop, since we will be printing next 5 IP range is set accordingly

- Check if the octets meet the restrictions

- Inside the loop, increase the forth octet by 1 on each iteration

- Check if octets reach the limit - 255, if they are greater than 255, calculate the mod and subtract 1. Then increase the previous octet by 1.

For example, if the input is: 1. 1. 20. 255, next ones will be:

1. 1. 21. 0

1. 1. 21. 1

1. 1. 21. 2

1. 1. 21. 3

1. 1. 21. 4

There is an exception for the first octet, if it reaches 255 and others also reach 255, this means there are no IP available.

- Print the result

8 0
3 years ago
Which statement, if any, about Boolean is false?
Vladimir79 [104]

Answer:

A.

Explanation:

7 0
3 years ago
Other questions:
  • 5. Are you more honest in your online communication? Explain your response.
    6·1 answer
  • Jenny is going on a trip to wildlife safari with her friends. She wants a camera that will help her shoot fast-moving animals. W
    15·2 answers
  • Two electronics technicians are measuring electrical quantities in circuits. Technician A says that copper, glass, porcelain, an
    11·1 answer
  • GIVING BRAINLIEST What does output allow a computer to do? Display information Receive information Do complex math problems Do m
    6·2 answers
  • Write a (java) program with a class called Sum1, using a while loop to add 10 numbers entered from the key-board.
    5·1 answer
  • By default the normal style inserts a vertical space equal to _____ lines between each line of text
    9·1 answer
  • ☢☢☢does anyone know how to do the TYNKER CANNON assignment ( lesson 2 intro to game design) I'll give BRANLIEST(¬‿¬)❤ dont answe
    11·2 answers
  • Write a program that prompts the user to enter a date, using integer values for the month, day, and year, and then prints out th
    9·1 answer
  • Name the major types of computer systems from slowest to fastest. ​
    9·1 answer
  • How many residues separate amino acids that are stabilized by hydrogen bonds in α helices?.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!