-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyLib.py
More file actions
38 lines (31 loc) · 910 Bytes
/
MyLib.py
File metadata and controls
38 lines (31 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import Globals
import math
import statistics
def loopListOutput():
while True:
angka = int(input())
if angka != 0:
Globals.list_output.append(angka)
else:
break
print(Globals.list_output)
def calculateList():
L = list(map(int, input().split(" ")))
print(L)
Globals.angka_sum = sum(L)
Globals.angka_avg = statistics.mean(L)
Globals.angka_med = statistics.median(L)
Globals.angka_min = min(L)
Globals.angka_max = max(L)
print(Globals.angka_sum)
print(Globals.angka_avg)
print(Globals.angka_med)
print(Globals.angka_min)
print(Globals.angka_max)
def winningChance():
list_tahun = list(map(int, input().split(" ")))
for tahun in list_tahun:
if tahun > 1990 and tahun < 2020:
if tahun % 2 == 1:
Globals.winning_count += 1
print(Globals.winning_count)