From 21350640dc0a4e343b1e82e97dbac73dc2120afc Mon Sep 17 00:00:00 2001 From: rizkyran Date: Tue, 8 Jun 2021 17:35:41 +0700 Subject: [PATCH 1/2] initial commit --- soal1.py | 0 soal2.py | 0 soal3.py | 0 soal4.py | 0 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 soal1.py create mode 100644 soal2.py create mode 100644 soal3.py create mode 100644 soal4.py diff --git a/soal1.py b/soal1.py new file mode 100644 index 0000000..e69de29 diff --git a/soal2.py b/soal2.py new file mode 100644 index 0000000..e69de29 diff --git a/soal3.py b/soal3.py new file mode 100644 index 0000000..e69de29 diff --git a/soal4.py b/soal4.py new file mode 100644 index 0000000..e69de29 From 80d817a3c7c970e294a6a95a954aa2e8e0f5ba5a Mon Sep 17 00:00:00 2001 From: rizkyran Date: Wed, 9 Jun 2021 17:52:13 +0700 Subject: [PATCH 2/2] done soal 3 --- soal3.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/soal3.py b/soal3.py index e69de29..5c3ac9a 100644 --- a/soal3.py +++ b/soal3.py @@ -0,0 +1,14 @@ +import math + +array = [1,2,3,5,4,3,1,4,5] + +def migrator(arr): + birds = [0]*len(arr) + for i in arr : + birds[i] += 1 + print(birds) + + mak = max(birds) + return birds.index(mak) + +print(migrator(array)) \ No newline at end of file