Design a python program with a loop that asks the user

Assignment Help Python Programming
Reference no: EM132355686

Question

Design a python program with a loop that asks the user to enter a series of positive numbers. The user should enter a negative number to signal the end of series. Once a user enters a negative number, your program should display the greatest and smallest number entered, the sum of all positive numbers and their average.

Example output:

The bold parts are what your programs do. Others are what user entered.

Enter a positive number. Enter negative number to quit. 57

Enter a positive number. Enter negative number to quit. 10

Enter a positive number. Enter negative number to quit. 8

Enter a positive number. Enter negative number to quit. -3

The sum of numbers is 75.

The average number is 25.

The greatest number is 57.

The smallest number is 8.

Reference no: EM132355686

Questions Cloud

What are the negative impacts of supplier credit : What are the negative impacts of supplier credit on the new business start-up?
Define relationship of china under dynasty with other states : The transition of India from a Hindu to a Muslim state was not a seamless one and it did not occur all at once. Regardless, Indians look to the Gupta period.
Display the prcjected rates fer the next six years : Write a program segment that uses a lccp to display the prcjected rates fer the next six years. Generate a random number between 1 and 1000.
Suppose you hold a share of stock and a put option on that s : If the stock price is below the exercise price when the option expires the price of your position is the price of the stock.
Design a python program with a loop that asks the user : Design a python program with a loop that asks the user to enter a series of positive numbers. The user should enter a negative number to signal.
Describe the characteristic of the germanic kingdoms : One characteristic of the Germanic kingdoms and settlements of western Europe (producing the so-called "Dark Ages"). One characteristic of the islamic empire.
Summary on the determinants of entrepreneurial success : RSS503 Statistics and Data Analysis Assignment, Singapore University of Social Sciences, Singapore. Summary on the determinants of entrepreneurial success
What is cross hedge : What is cross hedge? Explain in detail the procedure that, using an index futures, the market risk of a well-diversified portfolio is hedged.
What is this bond''s yield to maturity based on its ask price : If the bond dealer quotes prices of 101:2 and 101:14, what is this bond's yield to maturity based on its ask price?

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd