summaryrefslogtreecommitdiff
path: root/comp/work/40/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'comp/work/40/test.py')
-rw-r--r--comp/work/40/test.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/comp/work/40/test.py b/comp/work/40/test.py
new file mode 100644
index 0000000..345de38
--- /dev/null
+++ b/comp/work/40/test.py
@@ -0,0 +1,27 @@
+count = int(input("how many numbers will you input: "))
+nums = []
+for i in range(count):
+ nums.append(int(input(f"num {i}: ")))
+
+seen = []
+seenicount = []
+for i in range(len(nums)):
+ seenicount.append(0)
+ if nums[i] not in seen:
+ for j in nums:
+ if j == nums[i]:
+ seenicount[i] += 1
+ seen.append(nums[i])
+
+highest = 0
+multimodal = False
+for i in seenicount:
+ if i > highest:
+ highest = i
+ elif i == highest:
+ multimodal = True
+
+if (multimodal):
+ print("data was multimodal")
+else:
+ print(highest)