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
By default, which of these traffic source dimensions does google analytics capture for each user that visits your website?
natta225 [31]

The question above has multiple choices as listed;

<span />a. Source and Medium<span>
</span>

<span>b. Campaign and Ad Content</span>
<span />

<span>c. Campaign and Medium
</span><span>
</span><span>d. Source, Medium, Campaign, and Ad Content
</span>
<span />

<span>The correct answer is A. Source and Medium</span>

Source and medium combines the dimensions source and medium. Anyone referred to a website has an origin or a source. Examples of possible sources include Google, Facebook.com, and direct for those who typed your URL directly. Every referral, on the other hand, has a medium and possible examples of medium include organic, cost per click, referral, email, and none.






5 0
3 years ago
Why are new versions of applications packages released often ​
stellarik [79]

Answer:

The answer is "new version of application provides more easy to use".

Explanation:

  • In computer science, an application is a program, that is installed on the computer. There are many types of application software, that are "gaming software, working software, programming software, etc." At the end of time users want some new things in software to know users need programmer developed new versions of the software.
  • The update usually improves the device or service in its current version, whilst an improvement is an entirely new version. Installation is usually free and easy. You also have to wait for updates that are difficult to install.
5 0
2 years ago
And what way do you mixed and market economy support the ideals of democracy​
PolarNik [594]
Mixed and market economies protect individuals' ability to make their own economic decisions.
5 0
3 years ago
Which document would most likely be written in an informal style?
Masteriza [31]

Answer:

An advertisement for sportswear

Explanation:

An advertisement for sportswear would most likely be written in an informal style.

6 0
3 years ago
Which type of chart is preferable when you are dealing with a timeframe?
ANTONII [103]

Answer:

Pie chart

Explanation:

Just get to know

7 0
2 years ago
Other questions:
  • Katie created a web site that automatically scales to fit a cell phone. What kind of design did Katie use?
    12·2 answers
  • A security policy is a
    11·1 answer
  • What is the relationship between ionic bonds and cleavage
    13·1 answer
  • ______ is a disadvantage of EDI.
    8·1 answer
  • What are tributaries
    15·2 answers
  • A customer has contacted you to help him alleviate a large amount of time and effort that goes into adding and removing users wh
    14·1 answer
  • Write a C program to calculate and display the coordinates of midpoint - M of a linesegment between two given points - say A and
    7·1 answer
  • You are an IT network administrator at XYZ Limited. Your company has critical applications running of its Ubuntu Linux server. C
    6·1 answer
  • Why don’t the ads on Brainly load anymore
    14·2 answers
  • Software that converts program written in other language into machine language​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!