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
KonstantinChe [14]
2 years ago
10

Write a function that accepts a positive random number as a parameter and returns the sum of the random number's digits. Write a

program that generates random numbers until the sum of the random number's digits divides the random number without remainder. assembly language
Computers and Technology
1 answer:
Luba_88 [7]2 years ago
4 0

Answer:

Explanation:

The following Python program has a function called addDigits which takes a number as a parameter and returns the sum of the digits. Then the program creates a loop that keeps creating random numbers between 222 and 1000 and divides it by the value returned from the function addDigits. If the remainder is 0 is prints out a statement and breaks the loop, ending the program. The picture below shows the output of the program.

import random

def addDigits(num):

   sum = 0

   for x in str(num):

       sum += int(x)

   return sum

sum = addDigits(random.randint(222, 1000))

while True:

   myRandomNum = random.randint(2, 99)

   if (sum % myRandomNum) == 0:

       print("No remainder between: " + str(sum) + " and " + str(myRandomNum))

       break

You might be interested in
What are the qualities of different products that caught your eye and encourage you to buy them​
Ivan

Answer:

The qualities of different products that caught your eye and encourage you to buy them​ is described below in detail.

Explanation:

A fantastic method to do this would be to practice shiny colors in any advertisement you publish. This is an old method, but it's a great one. Glowing orange, for example, is sure to hold watching much higher than bland shades like gray. Play throughout here, and apply the color you think illustrates the eye most.

8 0
3 years ago
Why do businesses often provide a logo on their web pages?
Nitella [24]
<span>B. They provide viewers with a consistent visual reminder of their company.

This is a prevalent example of branding.</span>
7 0
3 years ago
Read the statement and justify your answer. “ICT is important for every field.”
Alja [10]

Explanation:

ICT permeates all aspects of life, providing newer, better, and quicker ways for people to interact, network, seek help, gain access to information, and learn. Besides its presence everywhere, Information and Communication Technology has an immense economic significance.

4 0
2 years ago
Answer this and you get free 100 points
Agata [3.3K]

Answer:

thanks my dude I needed it

5 0
3 years ago
Read 2 more answers
We study computer ___________ to become familiar with how circuits and signals collaborate to create working computer systems.
Arisa [49]

Answer:

organization

Explanation:

We study computer organization to become familiar with how circuits and signals collaborate to create working computer systems.

6 0
2 years ago
Other questions:
  • A/An is a series of instructions or commands that a computer follows; used to create software
    10·2 answers
  • The Spinning Jenny reduced the number of workers necessary to _______. a.remove cotton seeds from fibers b.pump water from the m
    7·1 answer
  • A Pool charges $4 each visit,or you can buy a membership. Write and solve an inequality to find how many times a person should u
    5·1 answer
  • Data means a group of numbers. <br> a. True<br> b. False
    7·1 answer
  • In this question, you must create a function in C++ using an external editor. When satisfied with your work, you shall attach it
    10·1 answer
  • How many bits would be in the memory of a computer with 4kb memory?
    8·1 answer
  • Alison retrieved data from a company database containing personal information on customers. When she looks at the SSN field, she
    14·1 answer
  • After Lola gave her friend the password to a protected website, her friend was able to remember it only long enough to type it i
    7·1 answer
  • Write a program that asks the user to enter a series of single digit numbers with nothing separating them. Read the input as a C
    12·1 answer
  • What is one disadvantage people face without a checking account?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!