mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-20 19:42:45 +08:00
Added Whitespace and Docstring (#924)
* Added Whitespace and Docstring I modified the file to make Pylint happier and make the code more readable. * Beautified Code and Added Docstring I modified the file to make Pylint happier and make the code more readable. * Added DOCSTRINGS, Wikipedia link, and whitespace I added DOCSTRINGS and whitespace to make the code more readable and understandable. * Improved Formatting * Wrapped comments * Fixed spelling error for `movement` variable * Added DOCSTRINGs * Improved Formatting * Corrected whitespace to improve readability. * Added docstrings. * Made comments fit inside an 80 column layout.
This commit is contained in:
@ -1,13 +1,20 @@
|
||||
"""Find mean of a list of numbers."""
|
||||
|
||||
|
||||
def average(nums):
|
||||
"""Find mean of a list of numbers."""
|
||||
sum = 0
|
||||
for x in nums:
|
||||
sum += x
|
||||
sum += x
|
||||
avg = sum / len(nums)
|
||||
print(avg)
|
||||
return avg
|
||||
|
||||
|
||||
def main():
|
||||
average([2, 4, 6, 8, 20, 50, 70])
|
||||
"""Call average module to find mean of a specific list of numbers."""
|
||||
average([2, 4, 6, 8, 20, 50, 70])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
main()
|
||||
|
Reference in New Issue
Block a user