for all numbers divisible by 7 . the user should provide both lower and upper limits.
and this is what i have so far
Lower =int(input("Enter the lower bound of your range:" ))
Upper =int(input("Enter the Upper bound of your range:" ))
nCount = 0
Sum = 0
for nCount in range (Lower,Upper+1):
n=int(nCount/7)
Sum = Sum + n
Average = (Sum)/nCount
Product = Sum * Average
print ("The numbers divisible by 7 in your range are:", n, end=" ")
print ("The sum of values divisible by 7 in your given range is: ", Sum)
print ("The Average of values divisible by 7 in your given range is: ", Average)
print ("The product of the sum and average of numbers divisible by 7 in your range is: ", Product)
This post has been edited by baavgai: 08 October 2012 - 07:30 AM
Reason for edit:: tagged

New Topic/Question
Reply



MultiQuote





|