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
Murljashka [212]
2 years ago
8

Write a program that prompts the user to input an integer and then outputs both the individual digits of the number and the sum

of the digits. For example, the program should: output the individual digits of 3456 as 3 4 5 6 and the sum as18,
Computers and Technology
1 answer:
mote1985 [20]2 years ago
4 0

The program is an illustration of loops; Loops are used for repetition

<h3>The actual program</h3>

The program written in Python, where comments are used to explain each line is as follows:

#This gets input for the number

n = int(input())

#This initializes the sum to 0

sumTotal = 0

#This iterates through the digits

for x in str(n):

   #This adds each digit

   sumTotal+=int(x)

   #This prints each digit

   print(x,end =' ')

#This prints a new line

print()

#This prints the total

print(sumTotal)

Read more about loops at:

brainly.com/question/24833629

#SPJ1

You might be interested in
Universal Containers are using Salesforce for Order Management and has integrated with an in-house ERP system for order fulfilme
Crazy boy [7]

Answer:

1. The change can be performed in Production, as it is a configuration change.

2. Integration with the ERP system may not function as expected.

Explanation:

3 0
3 years ago
Todays hard drives give up to or more than 1000gb of space. true or false
olya-2409 [2.1K]
Its true because most 2017 harddrives come with at least 250gb 
3 0
4 years ago
A line of code that begins with the while needs to end which symbol?<br> # <br> "<br> :<br> .
olga_2 [115]
<h2>A line of code that begins with the "while" needs to end with <u>":"</u> symbol</h2>

Explanation:

In python, the while loop statement has ":" at the end of the line.

<u>Syntax:</u>

while expression:

code(s) or statement(s)

<u>Example:</u>

cnt = 0

while (cnt < 5):

  print 'cnt:', cnt

  cnt = cnt + 1

Like other programming languages, while loop works in the same way except that in python it comes alone with "else" statement. When the condition is false, "else" statement gets executed.

<u>Example:</u>

#!/usr/bin/python

cnt = 0

while cnt < 5:

  print cnt, " is  less than 5"

  cnt = cnt + 1

else:

  print cnt, " is not less than 5"

3 0
3 years ago
Which of the following is NOT a possible combination of values of the variables in this program when it finishes running?
Nady [450]

Answer:

Definitely D

Explanation:

When you flip a coin it’s a 50/50 chance. Meaning it’s equal.

7 0
3 years ago
Read 2 more answers
How do you create a formula in excel​
Daniel [21]

Answer:

You can create a simple formula to add, subtract, multiply or divide values in your worksheet. Simple formulas always start with an equal sign (=), followed by constants that are numeric values and calculation operators such as plus (+), minus (-), asterisk(*), or forward slash (/) signs.

Let's take an example of a simple formula.

On the worksheet, click the cell in which you want to enter the formula.

Type the = (equal sign) followed by the constants and operators (up to 8192 characters) that you want to use in the calculation.

For our example, type =1+1.

Notes:

Instead of typing the constants into your formula, you can select the cells that contain the values that you want to use and enter the operators in between selecting cells.

Following the standard order of mathematical operations, multiplication and division is performed before addition and subtraction.

Press Enter (Windows) or Return (Mac).

Let's take another variation of a simple formula. Type =5+2*3 in another cell and press Enter or Return. Excel multiplies the last two numbers and adds the first number to the result.

Use AutoSum

You can use AutoSum to quickly sum a column or row or numbers. Select a cell next to the numbers you want to sum, click AutoSum on the Home tab, press Enter (Windows) or Return (Mac), and that's it!

AutoSum on the Home tab

When you click AutoSum, Excel automatically enters a formula (that uses the SUM function) to sum the numbers.

Note: You can also type ALT+= (Windows) or ALT+ COMMAND += (Mac) into a cell, and Excel automatically inserts the SUM function.

Explanation:

<u>HOPE </u><u>IT </u><u>HELPS</u>

8 0
3 years ago
Other questions:
  • Which socket type is soldered to the motherboard, along with the cpu?
    6·1 answer
  • How many steps are there on Mail Merge Task Pane? List them.​
    9·1 answer
  • What cable should i be using to connect my android tablet to the pc?
    13·2 answers
  • When was the very first computer made??
    5·1 answer
  • Write a program that requests the user input a word, then prints every other letter of the word starting with the first letter.
    5·1 answer
  • What has happened (or is still happening) to make this speech occur? armageddon
    15·1 answer
  • What is the output?<br> str = 'abcdef<br> print(str[2:50)
    6·2 answers
  • Write the application of computer in education and communication​
    9·1 answer
  • Que compone una maquina Rube Goldberg (operadores mecánicos- maquinas simples – mecanismos)
    8·1 answer
  • Write a recursive function called DigitCount() that takes a positive integer as a parameter and returns the number of digits in
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!