Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

find average with sum and len in python

# Python code to demonstrate the practical application
# of sum()
  
numbers = [1,2,3,4,5,1,4,5]
  
# start = 10
Sum = sum(numbers)
average= Sum/len(numbers) 
print (average)

# Output -
# 3
Comment

PREVIOUS NEXT
Code Example
Python :: pandas parallelize for loop 
Python :: pandas count number of repetitions of each diferent value 
Python :: create new list with for loop python 
Python :: numpy indexing arrays 
Python :: how to convert list to all uppercase 
Python :: heroku[web.1]: Process exited with status 3 
Python :: how to remove a letter from a string python 
Python :: check multiple keys in python dict 
Python :: compress excel file in python 
Python :: collections counter sort by value 
Python :: What does if __name_=="_main__": do? 
Python :: lists to dictionary python 
Python :: sudoku solver py 
Python :: python program to find the sum of fibonacci series 
Python :: np.arange in python 
Python :: Username Promt using Python with Character Limit 
Python :: django composite primary key 
Python :: exclude first value of an array python 
Python :: django url with string parameter 
Python :: manage python environment in jupyterlab 
Python :: make parameter optional python 
Python :: print without newline 
Python :: python slicing 
Python :: oops concept in python 
Python :: push in python 
Python :: how to check if a variable holds a class reference in python 
Python :: how to write a comment in python 
Python :: pandas resample friday 
Python :: tkinter simple application 
Python :: simple heatmap 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =