Untitled
Anonymous
plain_text
09/26/2023 1:59 PM
436 B
14
Indexable
def check_frequency(numbers):
number_count = {}
for num in numbers:
if num in number_count:
number_count[num] += 1
else:
number_count[num] = 1
for num, count in number_count.items():
print(f"{num} xuất hiện {count} lần")
numbers = [1,1,1,2,2,4,2,5]
check_frequency(numbers)Editor is loading...