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
IRISSAK [1]
3 years ago
7

Implement a function inValues() that asks the user to input a set of nonzero floating-point values. When the user enters a value

that is not a number, give the user a second chance to enter a value. After two mistakes in a row, quit the program. When the user enters 0, the function should return the sum of all correctly entered values. Use exception handling to detect improper inputs.
Computers and Technology
1 answer:
elena-s [515]3 years ago
5 0

Answer:

Explanation:

The following is written in Python and uses exception handling to do exactly as requested. It then goes adding all of the integer values to an array called num_list and finally adding them all together when the function ends.

def in_values():

   num_list = []

   while True:

       try:

           num = input("Input non-zero floating point: ")

           num = int(num)

           if num == 0:

               break

           else:

               num_list.append(num)

       except ValueError:

           print("No valid integer! Please try again ...")

           try:

               num = input("Input non-zero floating point: ")

               num = int(num)

               break

           except ValueError:

               break

   sum = 0

   for number in num_list:

       sum += number

   return sum

You might be interested in
A list is sorted in ascending order if it is empty or each item except the last one is less than or equal to its successor.
Sunny_sXe [5.5K]
The answer is true not false
4 0
3 years ago
Select two netiquette guidelines. In a paragraph of no less than 125 words, explain why these guidelines make professional onlin
Paladinen [302]

Respect others.

This means that it is important to make sure that your interactions with other internet users are based on respect for each other's resources. This includes time, bandwidth, and even emotions. Ensure that the information you are sharing is of value to the intended recipients and is sent in a timely manner. Treat other online users as you'd have them treat you.

Visualize your online conversations as you would real life conversations. Avoid being offensive and be accommodating of other peoples shortcomings. Also keep in mind who is part of the forum you are interacting with so as to use appropriate language. 



4 0
3 years ago
Explain ,how the computer network reduces cost of operation? (don't copy from any website)​
melomori [17]

Answer:

Computer network reduces the operation cost as it allows to share software and hardware in the network.

4 0
3 years ago
PLZZZ HELP!!!
kifflom [539]

Answer:

D the answer is D or c one of those 2

3 0
3 years ago
Select a cybersecurity career that interests you. Describe the job duties and identify the skills required to excel in that care
kykrilka [37]

Answer:

it's business

Explanation:

business you started with small and work for it grow up.

3 0
3 years ago
Other questions:
  • Which network could NOT carry commercial traffic?
    5·1 answer
  • I have an LG phone. Since I just bought my phone, my bill to text message isn't paid yet. I texted a couple of things playfully
    5·2 answers
  • You install a teanviewer on your work station at home so that you can access it when on the road. How can you be assured that un
    12·1 answer
  • Graphic design includes typefaces, page layouts, corporate logos, and product packaging. Which modern graphic designer is best k
    14·2 answers
  • Two types of formulas in Excel, what are they? A. Complex and simple, B. General and currency, C. Logical and Boolean, D. Trig a
    15·1 answer
  • 2 ways to make your computer work faster ( please help asap )
    6·1 answer
  • A user finished working on a computer in the lab. What should the user do so
    15·1 answer
  • b. Write a complete program for the following situation related to setting the speed of a car to preset values before starting a
    5·1 answer
  • It is manadatory to include a banner marking at the top of the page to alert the user that cui is present.
    9·2 answers
  • An end-user license agreement protects _____.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!