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
Reil [10]
3 years ago
12

Write and test a Python program to find and print the smallest number in a set of integer numbers. The program should read input

numbers until it reads a negative number. The negative number serves as a sentinel or marker telling the program when to stop reading numbers. The smallest of all numbers input as well as how many numbers were read (not considering the sentinel number) should be printed.
Computers and Technology
1 answer:
NikAS [45]3 years ago
6 0

Answer:

numbers = []

count = 0

while True:

   number = int(input("Enter a number: "))

   if number < 0:

       break

   else:

       numbers.append(number)

       count += 1

min_number = min(numbers)  

print(str(min_number) + " was the smallest among " + str(count) + " entered numbers.")

Explanation:

Initialize an empty array, to hold the entered numbers, and count as 0

Create a while loop that iterates until a specific condition is met

Inside the loop, ask the user to enter the numbers. When the user enters a negative number terminate the loop. Otherwise, add the entered number to the numbers array and increment the count by 1.

When the loop is done, find the smallest of the number in the numbers array using min method and assign it to the min_number.

Print the min_number and count

You might be interested in
A Hierarchy Custom Setting stores a specific URL for each profile in Salesforce. Which statement can a developer use to retrieve
Mariana [72]

Answer:

The correct answer is option (B) "{!$Setup.Url_Settings__C.URL__c}".

Explanation:

In computer programing using Visualforce, "$Setup" refers to a global merge field that gives the user access to hierarchical custom settings. In this case, the developer needs to retrieve the correct URL to access the current user's profile and display this on a Visualforce Page. "$Setup" will give the developer access to the hierarchical custom settings in Visualforce, and the command "Url_Settings__C.URL__c" will provide the root access to the current user's profile.

4 0
3 years ago
which tag does not display the text in the browser window and makes the sources code mode readable ?​
maxonik [38]

Answer:

HTML comments are not displayed in the browser, but they can help document ... You can add comments to your HTML source by using the following syntax: <! ... you can comment out HTML lines of code, one at a time, to search for errors: ... Use the HTML comment tag to make a comment out of the "This is a comment" text.

Explanation:

Gimme brainliest right now.

3 0
3 years ago
Given a PrintWriter reference variable named output that references a PrintWriter object, write a statement that writes the stri
Nadya [2.5K]

Answer:

A PrintWriter reference variable named output that references a PrintWriter object is as follows:

//PrintWriter output = new PrintWriter(outfile);

PrintWriter output = new PrintWriter("output.txt");

The statement that writes the string "Hello World" to the file output is as follows:

//output.print(message)

output.print("Hello World");

Explanation:

4 0
3 years ago
Type the correct answer in the box. Spell all words correctly. What type of network is the Internet? The Internet is an example
denis23 [38]

Answer:

The answer is WAN (Wide Area Network).

Explanation:

  • The Internet is an example of WAN. It stands for wide area network. It is an information network that commonly links to computers that cover a broad specific area. In a WAN, two towns, states, or countries are linked.  
  • The main purpose of using WAN includes a wide range, offers unified information, get upgraded files and software, several email sharing applications, etc.
6 0
3 years ago
Which type of software has no restrictions from the copyright holder regarding modifications of the softwares internal instructi
gizmo_the_mogwai [7]
The software that has no restrictions from copyright holder regarding modification of the software's internal and its redistribution is called an Open source software. They are being provided for use and redistribution for free, with no cost. They can be easily downloaded on the Internet.
4 0
3 years ago
Other questions:
  • You notice that lately your computer has been running slow. When you open up your web browser, you get endless pop-up ads to the
    8·1 answer
  • You are troubleshooting an interface issue on your cisco ios isr. the output of "show ip interface brief" indicates that etherne
    11·1 answer
  • What internet service provider first dominated the internet in the 1990s?
    15·1 answer
  • I have a question on an IT crossword the question is as follows
    12·1 answer
  • All web page urls begin with the letters ____.
    6·1 answer
  • 100 points please hurry!!!
    14·2 answers
  • For this assignment, select one of the organizations with a prominent IT department from the Topic 1 assignment. Once identified
    11·1 answer
  • Which expression is equivalent to 3x + 3x + 3x?<br><br> From Performance Matters
    11·2 answers
  • PLEASE ANSWER AND HURRY I'LL MARK YOU BRAINLIEST!!<br><br><br>​
    9·1 answer
  • Class Main {
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!