A community for students. Sign up today!
Here's the question you clicked on:
 0 viewing
 2 years ago
Write a program that finds
a.sum
b. average
c.product of sum and average for all numbers divisble by 7. The user should provide both the upper bound and the lower bound
2.write a program that finds the minimum number out of n numbers and the user should provide the numbers
NB: All programs should be in python
 2 years ago
Write a program that finds a.sum b. average c.product of sum and average for all numbers divisble by 7. The user should provide both the upper bound and the lower bound 2.write a program that finds the minimum number out of n numbers and the user should provide the numbers NB: All programs should be in python

This Question is Closed

estudier
 2 years ago
Best ResponseYou've already chosen the best response.0a) sum(range(1,11)) #sums numbers from 1 to 10 inclusive

estudier
 2 years ago
Best ResponseYou've already chosen the best response.0Why you keep reposting this question?

WilsonWorla
 2 years ago
Best ResponseYou've already chosen the best response.0Cos i haven'st got my answer yet.

WilsonWorla
 2 years ago
Best ResponseYou've already chosen the best response.0I want to modify this python program: n = int(input ("enter the number input; ")) sumN = 0 for nCount in range(n): inputNumber = int(input("Enter your next number; ")) sumN += inputNumber average = sumN/n print "The sum of the number is; ",sumN print "The average of the number is; ",average to meet the requirements of of the question posed.

DanSraer
 2 years ago
Best ResponseYou've already chosen the best response.1this is my solution for your first request: a = input("Enter the lower bound: ") b = input("Enter the upper bound: ") def my_function(a, b): if type(a) == int and type(b) == int: my_list = [] for i in range(a, b + 1): if i % 7 == 0: my_list.append(i) my_sum = float(sum(my_list)) my_average = float(my_sum / len(my_list)) my_product = my_sum * my_average print my_sum print my_average print my_product else: print "Invalid input data" my_function(a, b)

DanSraer
 2 years ago
Best ResponseYou've already chosen the best response.1my solution for your second request is: my_list = [] def my_function(*args): response = raw_input("Do you want to introduce a new number? ") if response != "y" and "Y": print "This program ends now." else: n = input("Your number is: ") my_list.append(n) my_function() my_function() print "The answer is: ", min(my_list)
Ask your own question
Ask a QuestionFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.