Write a program that reads some integers between 1 to 100 and counts the occurance of each.
nums_count = {} inp = input() while inp: num = int(inp) if num in nums_count: nums_count[num] += 1 else: nums_count[num] = 1 inp = input() for num, occurance in nums_count.items(): print(f'{num}: {occurance}')
Need a fast expert's response?
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!