Ashkent university of information technologies named after muhammad al-khwarizmi projecting algorithms


Download 23.76 Kb.
Sana16.06.2023
Hajmi23.76 Kb.
#1513239
Bog'liq
Algoritm



TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES NAMED AFTER MUHAMMAD AL-KHWARIZMI


PROJECTING ALGORITHMS
LAB WORK № 1


Done by: Zaynidinov Abbas
Checked by: Ravshanov Anvar
TASHKENT – 2022
27 - variant
1.N o`lchamli butun sonli massiv berilgan. Berilgan massivdagi har xil elementlar soni topilsin.
def count_distinct_elements(arr):
distinct_elements = set(arr)
return len(distinct_elements)
array = [1, 2, 3, 2, 4, 5, 1, 3]
distinct_count = count_distinct_elements(array)
print("Number of distinct elements:", distinct_count)
Number of distinct elements: 5


2.






3.


Download 23.76 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling