school

thing1's amazing school repo
Log | Files | Refs | Submodules | README

test.py (572B)


      1 count = int(input("how many numbers will you input: "))
      2 nums = []
      3 for i in range(count):
      4     nums.append(int(input(f"num {i}: ")))
      5 
      6 seen = []
      7 seenicount = []
      8 for i in range(len(nums)):
      9     seenicount.append(0)
     10     if nums[i] not in seen:
     11         for j in nums:
     12             if j == nums[i]:
     13                 seenicount[i] += 1
     14         seen.append(nums[i])
     15 
     16 highest = 0
     17 multimodal = False
     18 for i in seenicount:
     19     if i > highest:
     20         highest = i
     21     elif i == highest:
     22         multimodal = True
     23 
     24 if (multimodal):
     25     print("data was multimodal")
     26 else:
     27     print(highest)