Skip to content

Commit

Permalink
add average function
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Jul 19, 2020
1 parent bd984ad commit 70cfb5a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Certification/02. Python (Basic)/03. Average Function/Solution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import os

def avg(*arg):
return (sum(arg)/len(arg))


if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')

nums = list(map(int, input().split()))
res = avg(*nums)
fptr.write('%.2f' % res + '\n')

fptr.close()
Binary file not shown.

0 comments on commit 70cfb5a

Please sign in to comment.