Code
#function name finfAverage that recieves the list of
numbers
def findAverage(numList):
sum=0;#declare a varibale called sum that initial value is 0 and
store the sum of all the element of the lsit
for number in numList:#take one number at time from the list and
add to the sum
sum+=number
#find the Average by deviding the sum by len of the list
avg=sum/len(numList)
#print the Average of the list
print("Average is :",avg)
print("\nNumbes below Average are:")
for number in numList:
#this will print the numbers below Average
if(number<avg):
print(number)
print("\n\n")
#call the fucntion findAverage wiht three different list
findAverage([10,25,45,87,9,6,8,52,36])
findAverage([10,20,30,40,50,60,80,90])
findAverage([25,50,45,10,25,20.2])
output
code snap for indentation
If you have any query regarding the code please ask me in the comment i am here for help you. Please do not direct thumbs down just ask if you have any query. And if you like my work then please appreciates with up vote. Thank You.
Write a python function that can find the average of given list of numbers. It prints...
Write a python function that prints all odd numbers between two given numbers print_odd_numbers(10,20) → 11 13 15 17 19 print_odd_numbers(4,12) → 5 7 9 11 ### Your code here def print_odd_numbers(n1, n2):
1) Translate the following equation into a Python assignment statement 2) Write Python code that prints PLUS, MINUS, O ZERO, depending on the value stored in a variable named N. 3) What is printed by: 3 - 1 while 5: while 10 Print ) Page 1 of 9 4) Write a Python while loop that reads in integers until the user enters a negative number, then prints the sum of the numbers. 1-2 of 9 4) Write a Python while...
Write a Python function named print_nums that takes a single parameter, a list of float values, and prints out the list on a single line.enclosed in brackets, each value with three places after the decimal point, the values separated by two spaces. You do not have to provide comments for this code. Example 1: print_nums([3/3, 4/3, 573, 6/3]) prints: [1.000 1.333 1.667 2.000] Example 2: print_nums([3]) prints: [3.000] Example 3: print_nums([]) prints: []
Write a function in PYTHON that reads a sequence of numbers ended by 0 and prints “Sorted” if the numbers were input in increasing or decreasing order, otherwise the program must print “Not sorted” (Do not calculate 0) Sample Input 4 3 -1 -5 0 Sample Output Sorted
Using Python Programming Language: 3. Write a function flatten that takes a 2D list and returns all the items of each list concatenated together into one new 1D list. For example: flatten ([["a", "b"],["c","0"],["e","f"]]) would return ["a", "b","C","d", "e","f"] Save the function in a PyDev library module named functions.py Write a program t03.py that tests flatten function and prints the returned flat list to the screen. Test your program with a different list, hardcoded in t03.py • Copy the results...
Write a three parameter generic function that will average the numbers selected from a list but only those between low and high, inclusive. That is, this is a three parameter function, with list, low, and high cutoff values. Be careful, the average depends only on the selected numbers. B. Test your function with the salesRevenue list and having a low = 30 and high = 100. Your function should return the average of those numbers. Print this out, properly identified....
Q) How many seven digit numbers are divisible by 7? Write a function that prints a list with all seven digit number divisible by 7 Q) Write a function called removeMin() that removes the minimum value from a list. You cannot use the min function nor the remove method. If a list has more than one copy of the minimum value, remove only the first occurence.
Use Python 3.7 to write the following program: Given a list of n numbers, write a function to shift the numbers circularly by some integer k (k < n). The function should take a list, the amount to shift k, and an argument specifying the direction to shift (left or right). Suggestion: use the % operation and also you need a number between 0 inclusive and the length of the list.
1 write a Python function that takes in a list of integers and returns maximum and minimum values in the list as a tuple. Hint (can be done in one pass, you are not allowed to use built-on min and max functions.)max, min = find_max_min(my_list):2 write a Python function that takes in a list of integers (elements), and an integer number (num). The functions should count and return number of integers in elements greater than, less than, and equal to...
Python programming: Write a while loop that prints a. All squares less than n. For example, if n is 100, print 0 1 4 9 16 25 36 49 64 81. b. All positive numbers that are divisible by 10 and less than n. For example, if n is 100, print 10 20 30 40 50 60 70 80 90 c. All powers of two less than n. For example, if n is 100, print 1 2 4 8 16...