Skip to content

Commit

Permalink
Add mean; Add summation
Browse files Browse the repository at this point in the history
  • Loading branch information
za3k committed Oct 6, 2022
1 parent 9429292 commit 024b545
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mean
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/python3
import sys

count = 0
total = 0
for line in sys.stdin.readlines():
total += float(line)
count += 1
mean = total/count
mean = round(mean, 8)
if round(mean) == mean:
mean = int(mean)
print(mean)
2 changes: 2 additions & 0 deletions summation
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
paste -sd+ - | bc

0 comments on commit 024b545

Please sign in to comment.