mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-20 11:32:07 +08:00
Some directories had a capital in their name [fixed]. Added a recursive factorial algorithm. (#763)
* Renaming directories * Adding a recursive factorial algorithm
This commit is contained in:
14
maths/average.py
Normal file
14
maths/average.py
Normal file
@ -0,0 +1,14 @@
|
||||
def average(nums):
|
||||
sum = 0
|
||||
n = 0
|
||||
for x in nums:
|
||||
sum += x
|
||||
n += 1
|
||||
avg = sum / n
|
||||
print(avg)
|
||||
|
||||
def main():
|
||||
average([2, 4, 6, 8, 20, 50, 70])
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Reference in New Issue
Block a user