Question

Extra Credit Assignment 4 Write a PYTHON program that asks the user to enter a series...

Extra Credit Assignment 4

Write a PYTHON program that asks the user to enter a series of numbers. You can decide how many

numbers to enter or the user can.

As the user enters each number, add it to a list. After all the numbers are added, determine:

What is the highest number in the list

What is the lowest number in the list

What is the sum of all the numbers in the list

No error checking is required.

Points:

1.5 for the correct high number

1.5 for the correct low number

2 for the correct sum

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Enter your number : 3 Enter your number : 23 Enter your number : -1 Enter your number : 2 Enter your number : 4 Enter your nu

code:

def main():

#you can change below variable value to the number of times you want to ask user for a number

loop = 10

numbers = []

sumOfNumbers = 0

highest = 0

lowest = 0

#ask user for numbers

for i in range(loop):

num = int(input("Enter your number : "))

#initialize highest and lowest with first number entered

if i == 0:

highest = num

lowest = num

#add number to list

numbers.append(num)

#check if the number is greater than current highest

if num > highest:

highest = num

#check if the number is lowest than current lowest

if num < lowest:

lowest = num

#add number to sum

sumOfNumbers += num

print("Numbers entered : ",numbers)

print("Highest number : ",highest)

print("Lowest number : ",lowest)

print("Sum of numbers : ",sumOfNumbers)

main()

Add a comment
Know the answer?
Add Answer to:
Extra Credit Assignment 4 Write a PYTHON program that asks the user to enter a series...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Description: Write a program that asks the user to enter a series of numbers, and report...

    Description: Write a program that asks the user to enter a series of numbers, and report the following: • The maximum number in the series • The minimum number in the series • The average of all positive numbers in the series The user will enter a pound key ‘#’ to stop the series. in Python

  • Design a program that asks the user to enter a series of 20 numbers. The program...

    Design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in the array and then display the following data: The lowest number in the array The highest number in the array The total of the number in the array The average of the numbers in the array PLEASE GIVE THE PSEUDOCODE AND CODE IN C PROGRAMMING

  • Design a program in pseudocode that asks the user to enter a string containing a series...

    Design a program in pseudocode that asks the user to enter a string containing a series of ten single-digit numbers with nothing separating them. The program should display the sum of all the single digit numbers in the string except for the highest value digit. You may only use one main module and one sorting function; otherwise, do not modularize your program. For example, if the user enters 5612286470, the sum would be 33. (0+1+2+2+4+5+6+6+7) If there are multiple highest...

  • IN PYTHON write a program that asks the user to enter 10 numbers and store them...

    IN PYTHON write a program that asks the user to enter 10 numbers and store them in the list and then find the followings: • Maximum • Minimum prime numbers in the list • even numbers in the list • odd numbers in the list.

  • Python Code Write a program using functions and mainline logic which prompts the user to enter...

    Python Code Write a program using functions and mainline logic which prompts the user to enter a number. The number must be at least 5 and at most 20. (In other words, between 5 and 20, inclusive.) The program then generates that number of random integers and stores them in a list. The random integers should range from 0 to 100. (You can use a wider range if you want, but the lower end of the range must be at...

  • extra credit 1 Write a program that will display the following menu and prompt the user...

    extra credit 1 Write a program that will display the following menu and prompt the user for a selection: A) Add two numbers B) Subtract two numbers C) Multiply two numbers D) Divide two numbers X) Exit program The program should: display a hello message before presenting the menu accept both lower-case and upper-case selections for each of the menu choices display an error message if an invalid selection was entered (e.g. user enters E) prompt user for two numbers...

  • Write a program using M.I.P.S that asks user “how many positive number that is devisable by...

    Write a program using M.I.P.S that asks user “how many positive number that is devisable by 6 you want to add?” .Then your loopcounter would be the user input. If the user enters a positive number between 1 and 100 that is devisable by 6, you increment your loop counter and add it to the sum.. You need to decide if the positive number entered by the user is divisible by 6 or not. Your program should print an error...

  • Write a program that allows the user to enter a series of exam scores. The number...

    Write a program that allows the user to enter a series of exam scores. The number of scores the user can enter is not fixed; they can enter any number of scores they want. The exam scores can be either integers or floats. Then, once the user has entered all the scores they want, your program will calculate and print the average of those scores. After printing the average, the program should terminate. You need to use a while loop...

  • Can you help me write a Python 3.7 code for this question? Write a program using...

    Can you help me write a Python 3.7 code for this question? Write a program using functions and mainline logic which prompts the user to enter a number, then generates that number of random integers and stores them in a list. It should then display the following data to back to the user: The list of integers The lowest number in the list The highest number in the list The total sum of all the numbers in the list The...

  • In Python, write a program that asks the user for a positive integer number. If the...

    In Python, write a program that asks the user for a positive integer number. If the user enters anything else, the program would ask the user to re-enter a number or enter -1 to quit. If it is a positive number, the program then prints out a multiplication table that goes up to that number. For example, if the user enters 10, the output would look something like this. https://www.vectorstock.com/royalty-free-vector/multiplication-table-on-white-background-vector-2721686

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT