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
insens350 [35]
3 years ago
12

Create a program that will find and display the largest of a list of positive numbers entered by the user. The user should indic

ate that he/she has finished entering numbers by entering a 0.
Computers and Technology
1 answer:
FinnZ [79.3K]3 years ago
5 0

Answer:

<em>This program is written using Python Programming language,</em>

<em>The program doesn't make use of comments (See explanation section for line by line explanation)</em>

<em>Program starts here</em>

print("Enter elements into the list. Enter 0 to stop")

newlist = []

b = float(input("User Input: "))

while not b==0:

    newlist.append(b)

    b = float(input("User Input: "))

newlist.sort()

print("Largest element is:", newlist[-1])

Explanation:

This line gives the user instruction on how to populate the list and how to stop

print("Enter elements into the list. Enter 0 to stop")

This line creates an empty list

newlist = []

This line enables the user to input numbers; float datatype was used to accommodate decimal numbers

b = float(input("User Input: "))

The italicized gets input from the user until s/he enters 0

<em>while not b==0:</em>

<em>     newlist.append(b)</em>

<em>     b = int(input("User Input: "))</em>

This line sorts the list in ascending order

newlist.sort()

The last element of the sorted list which is the largest element is printed using the next line

print("Largest element is:", newlist[-1])

You might be interested in
Tom's Art Supplies used to sell art supplies through mail order catalogs, but the company's order takers often had difficulty de
olganol [36]
The answer is:bbbbbbbb
6 0
3 years ago
Disadvantages assembly level language for programming ​
Alisiya [41]
It takes a lot of time and effort to write the code for the same. It is very complex and difficult to understand. The syntax is difficult to remember. It has a lack of portability of program between different computer architectures.

Hope that helps
7 0
3 years ago
Read 2 more answers
What is the definition of "potential energy"?
muminat
Well potential energy is energy that is in a object while its not moving so i would go your third option 
4 0
3 years ago
Read 2 more answers
The random module is a group of functions that are used to deal with random numbers.
maksim [4K]
True because it is the
5 0
3 years ago
Read 2 more answers
Which of the following statements about crane hand signal training are true? A. Both statements are true about crane hand signal
Alenkinab [10]
The correct option is A.
When using crane at a construction site, it is required that:
1.A poster should be posted at the job site with an illustration of the hand signals that every operator and personnel working with the crane and around the crane must know.
2. Hand signals for crane and derrick operators should be those set by the American National Standard institute customize for the type of crane in use.<span />
5 0
3 years ago
Other questions:
  • The mathematical order of operations is used in Excel when formulas are evaluated. This order of operations states the order to
    9·2 answers
  • What 2 major agricultural inventions did jethro tull create?
    10·2 answers
  • How can I make a website login system with only using php?​
    6·1 answer
  • Concept about borderless classroom because of technology​
    9·1 answer
  • Write a program that performs the following tasks: Display a friendly greeting to the user Prompt the user for the value to conv
    13·1 answer
  • What is the purpose of the GETPIVOTDATA function?
    13·2 answers
  • Tennis players are not allowed to swear when they are playing in Wimbledon
    6·2 answers
  • What is the difference between KE an PE
    8·1 answer
  • How do you think weather can affect sailing?<br><br>What would be good sailing weather?​
    9·1 answer
  • To make the monster pace, you needed the monster to turn ___ degrees.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!