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
PilotLPTM [1.2K]
3 years ago
15

Use a while loop to repeatedly take input from the user and calculate a sum. The user will only be allowed to type in numbers, b

ut remember the input function returns strings (so you will need to convert them with the built-in int function). If the user inputs the value -999, then the program should stop and print out the sum of all the numbers entered.
Computers and Technology
1 answer:
aev [14]3 years ago
3 0

Answer and Explanation:

#take input from user

n = int(input("Enter any number: "))

#sum variable to store sum

sum=0

#condition to exit from loop

while n!=-999:

   #adding entered number in sum variable

  sum=sum+n

  #take input from user

  n = int(input("Enter any number : "))

#print the sum  

print("sum =",sum)

output:

Enter any number: 10

Enter any number : 100

Enter any number : -999

sum = 110

You might be interested in
Bob received a message from Alice which she signed using a digital signature. Which key does Bob use to verify the signature?Gro
alexira [117]

Answer:

Alice's public key

Explanation:A Public key is a key that can be used for verifying digital signatures generated using a corresponding private key which must have been sent to the user by the owner of the digital signature.

Public keys are made available to everyone required and they made up of long random numbers.

A digital signature signed with a person's private key can only be verified using the person's private key.

7 0
4 years ago
I will mark you Brainliest if you could guess how old i am :3
ra1l [238]

Answer:

you are 17

Explanation:

6 0
4 years ago
What is the BCC feature used for?
exis [7]

Answer:

to send an email to someone without revealing that person’s email address to others on the distribution list

Explanation:

BAM

7 0
3 years ago
Read 2 more answers
I'd: 9872093250, password: qqqqq, join the meeting​
jenyasd209 [6]
No thanks but Happy Mother’s Day!!!
8 0
3 years ago
Unscramble dki-----------------------------------------------------------------------...........
Fudgin [204]

Answer:

hmmmm.. kid?

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • Which major and minor keys have no sharps or flats apex?
    5·2 answers
  • Why do local variables lose their values between calls to the function in which they are
    5·1 answer
  • The information that’s displayed in a datalist control is defined by _____.
    10·1 answer
  • ROM is a volatile memory. true or false​
    11·1 answer
  • Which of these communication avenues is not regulated by the Federal Communications Commission (FCC)?
    12·1 answer
  • Which role involves designing and creating advertisements for marketing purposes?
    14·1 answer
  • ......... defines the path of the movement for an object.
    12·1 answer
  • Computer programming 5
    10·1 answer
  • Do you think the current video game industry is likely to experience another “crash” (similar to the one in the 1980s) any time
    10·1 answer
  • This is a standard routine used to perform a mathematical task in excel is called?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!