Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to calculate average in list python by using whil loop

def avg(list):
    s = 0
    total = 0.0
    while(s < len(list)):
        total = total + list[s]
        s = s+1
    return total/len(list)
ans = avg([1, 2, 3, 4, 5])
print(ans)
Comment

PREVIOUS NEXT
Code Example
Python :: get node name dynamo revit 
Python :: vs python 
Python :: multiply two list in python using lambda 
Python :: mechanize python #12 
Python :: how to implement nfa in python 
Python :: deine dict with same values 
Python :: django-filter field name greater than 
Python :: EXCEL , EXTRAER DELIMITADOR 
Python :: how to run function when file is modified python 
Python :: inline_ternary(if)_condition 
Python :: java scirpt 
Python :: round(len(required_skills.intersection(resume_skills)) / len(required_skills) * 100, 0) 
Python :: # swap variables 
Python :: str vs rper in python 
Python :: clear terminal anaconda 
Python :: pandas replace column values 
Python :: two lists with identical entries get order 
Python :: insertion sort algorithm in descending order 
Python :: Find Factors of a Number Using for Loop 
Python :: Python return statement (Write and Call Function) 
Python :: faceModel = "opencv_face_detector_uint8.pb" 
Python :: codeforces 1133A in python 
Python :: python create empty list with size 
Python :: how to check weight value in keras neurons 
Python :: Python NumPy atleast_3d Function Syntax 
Python :: regex re speed 
Python :: Python NumPy asarray_chkfinite Function Example Tuple to an array 
Python :: catch all event on socketio python 
Python :: Python __ne__ 
Python :: simpy 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =