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
anzhelika [568]
4 years ago
7

Write a Python program that asks the user to enter a series of single-digit numbers with nothing separating them.

Computers and Technology
1 answer:
d1i1m1o1n [39]4 years ago
5 0

The Python 3 code for the program described in the question:

def sum_digits(str):

sum = 0

for c in str:

sum += int(c)

return sum

def main():

print("Enter series of single-digit numbers with no spaces: ")

str = input()

print("The sum of digits of the entered number is", sum_digits(str))

main()

You might be interested in
Bill's manager has asked him to send all staff members the directions for checking out the new projector. In one to two sentence
lawyer [7]
He could probably send an email to everyone.
or if they are at work he could conduct a conference.Or can paste the instructions on a public tasks board.

Hope it helps you.

:)
3 0
3 years ago
Read 2 more answers
In order to paint a wall that has a number of windows, we want to know its area. Each window has a size of 2 ft by 3 ft. Write a
Oksana_A [137]

Answer:

The program in Java will be:

import java.util.Scanner;

public class Paint

{

   public static void main(String[] args)

   {

       final int COVERAGE = 350;  //paint covers 350 sq ft/gal

       final int DOOR = 20;

   final int WINDOW = 15;    

   //declare integers length, width, and height;

   int length, width, height, doors, windows;

   //declare double totalSqFt;

   double totalSqFt;

       //declare double paintNeeded;

   double paintNeeded;

     //declare and initialize Scanner object

   Scanner scan = new Scanner (System.in);

   //Prompt for and read in the length of the room

   // finish this -- length =  

   System.out.print("Enter the length of the room: ");

   length = scan.nextInt();

   //Prompt for and read in the width of the room

       System.out.print("Enter width: ");

   width = scan.nextInt();

       //Prompt for and read in the height of the room

   System.out.print("Enter height: ");

   height = scan.nextInt();

       //Prompt for and enter the number of doors    

   System.out.println("Enter the number of doors: ");

   doors = scan.nextInt();

   //Prompt for and enter the number of windows

   System.out.println("Enter the number of windows: ");

   windows = scan.nextInt();

   //Compute the total square feet to be painted--think

      //about the dimensions of each wall

       totalSqFt = 2 * width * height + 2 * length * height - DOOR*doors - WINDOW*windows;

       //Compute the amount of paint needed

       paintNeeded = totalSqFt / COVERAGE;

       //Print the length, width, and height of the room and the

       //number of gallons of paint needed.

   System.out.println("Length= " + length + "\nWidth= " + width +  "\nHeight= " + height + "\nNumber of doors: " + doors + "\nNumber of windows: " + windows + "\nGallons of Paint Needed= " + paintNeeded);

   

   }

}

5 0
4 years ago
Read 2 more answers
What is a short example of public domain?
ikadub [295]
Something that isn't subject to copyright.
6 0
3 years ago
Which of the following is true of lossy and lossless compression algorithms?
taurus [48]

B. Lossy compression algorithms are typically better than lossless compression algorithms at reducing the number of bits needed to represent a piece of data.

7 0
3 years ago
Try to determine how much money you would have if for a month you were given a nickel on day one, two nickels on day two, three
DIA [1.3K]

Answer:

Since this is a recursive function,

you would be using a be using the a(n) = d(n-1) + a1 meaning that it's the previous entry plus the difference process.

a(n) = a1 + (n -1)d

a30 = .05 + (30-1).05

a30 = $29.10

Explanation:

Sorry It's late, hope this can help other people.

6 0
3 years ago
Other questions:
  • What does this say:<br> √ans
    6·2 answers
  • Samuel is working on decimal and binary conversion for his college project.He is using the binary number 111011 and wants to exp
    8·1 answer
  • Why is operating system pivotal in teaching and learning
    11·1 answer
  • PLEASE help me RIGHT NOW!!!!!!!!! I will give a Brainly to anyone who helps me!
    15·1 answer
  • Henry is having a problem with the electrical system on his current laptop. The battery for the laptop will not charge. Henry to
    13·1 answer
  • Describe what each of the following functions in R do.1. t2. matplot3. c4. seq5. legend6. matrix7. rownames8. colnames9. type of
    14·1 answer
  • The data type of 17.3 should be ________________.
    12·2 answers
  • 8. Cloud Storage is
    5·2 answers
  • Describe what impact your personal vision could have your community or on society​
    6·1 answer
  • If you want to create a line of code that will not appear in the interpreter, what symbol should begin the line?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!