It's the academic year's end, fateful moment of your school report.
The averages must be calculated. All the students come to you and entreat you to calculate their average for them.
Easy ! You just need to write a script.

Return the average of the given array rounded **down** to its nearest integer.

The array will never be empty.

Difficulty: introductory

Starter code:

def get_average(marks):
	

Solutions:
def get_average(marks):
    return sum(marks) // len(marks)


def get_average(marks):
    average = sum(marks) / len(marks)    
    return int(average)


import numpy

def get_average(marks):
    return int(numpy.mean(marks))

get_average = lambda marks: sum(marks)//len(marks)
    


def get_average(marks):
    return int(sum(marks)/len(marks))
    


get_average = lambda m: int(__import__("numpy").mean(m))

import math
import numpy
def get_average(marks):
    number =  numpy.average(marks)
    return math.floor(number)

import math


def get_average(marks):
    sum = 0
    for num in marks:
        sum += num
    total = sum / len(marks)
    return math.floor(total)

import math

def get_average(marks):
    
    x = (len(marks))
    y = (sum(marks))
    
    i = y/x 
    
    return math.floor(i)


def get_average(marks):
    suma=0
    for x in marks:
        suma=suma+x
    return (suma//len(marks))


get_average =lambda x: sum(x)//len(x)

def get_average(marks):
    mean = sum(marks)/len(marks)
    return int(mean)


def get_average(marks):
    return sum(n for n in marks) // len(marks)

import math


def get_average(marks):
    return math.floor(sum(marks)/len(marks))


from math import trunc
def get_average(marks):
    return trunc(sum(marks)/len(marks))


def get_average(marks):
    sum = 0
    for x in marks:
        sum = sum + x
    num = len(marks)
    ans = sum/num
    return int(ans)

import pandas as pd

def get_average(marks):
    s = pd.Series(marks)
    return int(s.mean())

def get_average(marks):
    return int(__import__("statistics").mean(marks))


import numpy, math
def get_average(marks):
    return math.floor(numpy.mean(marks))


def get_average(marks):
    res =  int(sum(marks)/len(marks))
    return res
    raise NotImplementedError("TODO: get_average")


import math

def get_average(marks):
    number = len(marks)
    total = 0
    
    
    for student in marks:
        total = total + student
        
    return math.floor(total/number)
        


def get_average(marks):
    num = 0
    for i in marks:
        num += i 
    return (int) (num/(len(marks)))

def get_average(marks):
    sum = 0
    for i in range(len(marks)):
        sum += marks[i]
        i += 1
    return int(sum/len(marks))


import math
def get_average(marks):
    t = sum(marks) / len(marks)
    return math.floor(t)


def get_average(marks):
    count=0
    for i in range(len(marks)):
        count+=marks[i]
    return round(count//len(marks))

def get_average(marks):
    total = 0
    for k in range(len(marks)):
        total += marks[k]
    return total // len(marks)


def get_average(marks):
    sum=0
    for n in marks:
        sum=sum+n
    avg=sum//len(marks)
    return avg

def get_average(marks):
    # assumption array is never empty
    # get average of an array and return
    
    # will use sum and len of array to get average
    # rounded down to nearest integer
    avg = sum(marks) // len(marks)
    return avg
    
    
    
    # raise NotImplementedError("TODO: get_average")


def get_average(marks):
    mean = 0.0
    sum = 0
    for i in marks:
        sum += i
    mean = sum/len(marks)
    return int(mean)
    


def get_average(marks):
    sum = 0
    for i in marks:
        sum = sum + i
    
    average = sum / len(marks)
    return int(average)
    
    
    raise NotImplementedError("didn't work for" + marks)

print(( get_average([2, 2, 2, 2])))
print(( get_average([1, 5, 87, 45, 8, 8])))
    
    


import math


def get_average(marks):
    marks_sum = 0
    for mark in marks:
        marks_sum += mark
    average_mark = marks_sum / len(marks)

    return math.floor(average_mark)


print((get_average([2,5,13,20,16,16,10])))


def get_average(marks):
    get_average= int(sum(marks)/len(marks))
    return round(get_average)
    raise NotImplementedError("TODO: get_average")
    


def get_average(marks):
    for i in marks:
        return int(round(sum(marks)/len(marks), 1))


import math as math

def get_average(marks):
    average = math.floor(sum(marks) / len(marks))
    return average


def get_average(marks):
    sum=0
    for v in marks:
        sum+=v
    average=int(sum/len(marks))
    return average

def get_average(marks):
    import math
    n = 0
    for i in marks:
        n += i
    result = n/len(marks)
    result = math.floor(result)
    return result    


def get_average(marks):
    
    avg = 0
    
    for mark in marks:
        avg += mark
        
    avg /= len(marks)
    
    return int(avg)


def get_average(marks):
   
    
    sum_marks = sum(marks)
    len_marks = len(marks)
    avg_marks = sum_marks // len_marks
    return avg_marks


def get_average(marks):
#     raise NotImplementedError("get_average")
    return sum(marks)// len(marks)


from math import *

def get_average(marks):
    result = 0 
    for index in marks:
        result = result + index
    result = (result / len(marks))
    return floor(result)


def get_average(marks: list) -> int:
    """ This function returns the average of the given array. """
    return (sum(marks)//len(marks))


import math
def get_average(marks):
    count=0
    sum=0
    for x in marks:
        sum+=x
        count+=1
    return math.floor(sum/count)


def get_average(marks):
    y = 0
    for n in range(len(marks)):
        y = y + marks[n-1]
    return int(y / len(marks))

def get_average(marks):
    result = 0
    counter = 0
    
    for item in marks:
        result += item
        counter += 1
    
    return int(result / counter)


def get_average(marks):
    x=len(marks)
    
    somma=sum(marks)
    media=somma/x
    
    return int(media)


def get_average(marks):
    total = 0 
    for x in marks:
        total += x 
    return round(int(total / len(marks)))

def get_average(marks):
    total = 0
    for m in marks:
        total += m
    return total // len(marks)
        



def get_average(marks):
    avg = 0
    for elem in marks:
        avg += elem
    avg = avg / len(marks)
    
    return int(avg)


import math
def get_average(marks):
    res=sum(marks)/len(marks)
    return math.ceil(res) if math.ceil(res)<math.floor(res) else math.floor(res)


def get_average(marks):
    #raise NotImplementedError("TODO: get_average")
    average = 0
    for a in marks:
        average += a
    return int(average/len(marks))

marks = [2,5,13,20,16,16,10]
def get_average(marks):
    sum = 0
    for mark in marks:
        sum = sum+mark
    return int(sum / len(marks))

def get_average(marks):
    total_marks = 0
    for i in marks:
        total_marks += i
    average = total_marks / len(marks)
    return int(average)


def get_average(marks):
    sum = 0
    for score in marks:
        sum += score
    return int(sum / len(marks))


def get_average(marks):
    average = sum(marks) // len(marks) # Floor division to automatically round down.
    return average


import math
def get_average(marks):
    s=0
    avg=0
    for i in marks:
        s+=i
        avg=s/len(marks)
    return math.floor(avg)
        
                           


import math
def get_average(marks):
    count = 0
    average = 0
    for num in marks:
        count += num
    average = count / len(marks)
    return math.floor(average)

def get_average(marks):
    x = 0
    for i in marks:
        x += i 
    x = x / len(marks)
    return int(x)


import math 

def get_average(marks):
    average = sum(marks) // len(marks)
    return math.floor(average)
   



import math
def get_average(marks):
    s=0
    for k in marks:
        s+=k
    return math.floor(s/len(marks))


    
    raise NotImplementedError("TODO: get_average")


import math

def get_average(marks):
    sum = 0
    for i in marks:
        sum += i
    average = math.floor(sum/len(marks))
    return average

def get_average(marks):
    media=0
    i=0
    for element in marks:
        i=i+1
        media=media+element
    media=media//i
    return media


def get_average(marks):
    total=sum(e for e in marks)
    return int(total/len(marks))

import math
def get_average(marks):
   # raise NotImplementedError("TODO: get_average")
    marks_sum=0
    for i in marks:
        marks_sum+=i
    return  int(marks_sum/len(marks))


def get_average(marks):
    a = len(marks)
    b = 0
    for i in range(0,len(marks)):
        b = b + marks[i]
    average = int(b/a)
    return average
#    raise NotImplementedError("TODO: get_average")


def get_average(marks):
    total = 0
    for i in marks:
        total = total + i
    avg = total // len(marks)
    return avg

# alternatively
# from statistics import mean as m
# from math import floor as f

# def get_average(marks):
#     avg = m(marks)
#     return f(avg)


def get_average(marks):
    
    sum = 0
    mylen = len(marks)
    for x in marks:
        sum = sum + x
    
    avg = sum / mylen
    return int(avg)


from math import floor

def get_average(marks):
    media = sum(marks)/len(marks)
    return floor(media)

def get_average(marks):
    import math as ma
    return ma.floor(sum(marks)/len(marks))


from math import floor
def get_average(marks):
    sum = 0
    for mark in marks:
        sum += mark
    return floor(sum / len(marks))
        


import math

def get_average(marks):
    sum = 0
    for mark in marks:
        sum = sum + mark
    return math.floor(sum/len(marks))


def get_average(marks):
    tot = 0
    for i in marks:
        tot = tot + i
        
    avg = int(tot/len(marks))
    
    return avg


import math
def get_average(marks):
    soma = 0
    
    if (len(marks)>0):
        for i in marks:
            soma += i
        
        media = soma/len(marks)
        return math.floor(media)
    

print (get_average([1,2]))

import numpy as np
import math
def get_average(marks):
    return math.floor(np.average(marks))

def get_average(marks):
    suma = sum(marks)
    return suma//len(marks)
    raise NotImplementedError("TODO: get_average")


import statistics
import math


def get_average(marks):
    get_mean = statistics.mean(marks)
    rounded = math.floor(get_mean)
    return rounded


def get_average(marks):
    total=0
    x=0
    for  n in marks :
        total+= marks[x]
        x+= 1
    
    return total//len(marks)


def get_average(marks):
    a = sum(marks)
    l = len(marks)
    average = a//l
    return average


def get_average(marks):
    sum = 0
    for n in marks:
        sum = sum + n
    sum
    return int(sum/len(marks))


def get_average(marks):
    a = sum(marks)/ len(marks)
#     result = round(int(a), 0)
    return int (a)

def get_average(marks):
    
    sum_init = 0 
    for i in range(0,len(marks)) :
        sum_init = sum_init + marks[i] 
    
    return sum_init//len(marks)


import math
def get_average(marks):
    soma = 0
    
    if (len(marks)>0):
        for i in marks:
            soma += i
    
        media = soma/len(marks)
        return math.floor(media)

print (get_average([1,2,15,15,17,11,12,17,17,14,13,15,6,11,8,7]))

def get_average(marks):
    print((sum(marks)/len(marks)))
    return int((sum(marks)) / len(marks))


import numpy
import math

def get_average(marks):
    
    # raise NotImplementedError("TODO: get_average")
    # Faz a média do vetor 
    c = numpy.mean(marks)
    
    # Com a média, devolve o inteiro mais próximo arrendondado por decréscimo
    d = math.floor(c)
    
    return d

import numpy
import math

def get_average(marks):
    
    # raise NotImplementedError("TODO: get_average")
    
    c = numpy.mean(marks)
    d = math.floor(c)
    
    return d

import numpy as np
def get_average(marks):
    return np.mean(marks) // 1


from functools import *

def get_average(marks):
    nth = len(marks)
    aggregate = reduce(lambda x,y : x+y,marks)
    return aggregate // nth


import math

def get_average(marks):
    sum = 0
    for x in marks:
        sum = sum + x
    return math.floor(sum / len(marks))
    


def get_average(marks):
    return int(sum(marks) / len(marks))
    raise NotImplementedError("didn't work for", get_average)

from math import floor #import function to round down
from statistics import mean #import function to calculate average
def get_average(marks):
    return floor(mean(marks))


import math
def get_average(marks):
    res=0
    for i in marks:
        res= i + res
    return math.floor(res/len(marks))
    raise NotImplementedError("TODO: get_average")


def get_average(marks):
    length=len(marks)
    sum=0
    for i in range(0,length):
        sum= sum+marks[i]

    return int(sum/length)


import math
def get_average(marks):
    x = 0
    y = 0
    for mark in marks:
        x = x + 1
        y = y + mark
    return math.floor(y / x)

# def get_average(marks):
#     return sum(marks)

def get_average(marks):
    suma=0
    for x in marks:
        suma=suma+x
    return (suma//len(marks))

import math
def get_average(marks):
    sum = 0
    for n in marks:
        sum+=n
    length = len(marks)
    average = sum/length
    return math.floor(average)


def get_average(marks):
    answer = 0
    
    for grades in marks:
        answer += grades

    return answer // (len(marks))


import numpy as np

def get_average(marks):
    return((np.mean(marks).astype(int)))


def get_average(marks):
    
    
    import math
    x = (marks, math.floor(sum(marks)/len(marks)))
    
    return x[-1]