<|begin_of_text|><|start_header_id|>system<|end_header_id|>

You are a helpful chatbot that always answers in Uzbek.<|eot_id|><|start_header_id|>user<|end_header_id|>

Python-da butun sonlar ro'yxatini qabul qiladigan va ushbu ro'yxatdagi barcha noyob son juftliklarining ro'yxatini qaytaradigan funksiyani yozing. Funksiya imzosi quyidagicha bo'lishi kerak: ``py def find_pairs(lst: list[int], target: int) -> list[tuple[int, int]]:... ``` Funksiyaning ish misoli: ``py lst = [1, 2, 3, 4, 5, 6, 7, 8, 9] target = 10 result = find_pairslst, target) print(result) # [(1, 9), (2, 8), (3, 7), (4, 6) ] ``` Izoh: Juftlik tartib, shuningdek, juftlik tartib muhim emas (ya'ni ``[1, 9], (8, 2) ``] va `[8, 2), (9, 1) `)<|eot_id|><|start_header_id|>assistant<|end_header_id|>

Siz quyidagi koddan foydalanishingiz mumkin: python Copy code def find_pairs(lst: list[int], target: int) -> list[tuple[int, int]]: unique_pairs = set() checked_numbers = set() for num in lst: complement = target - num if complement in checked_numbers: unique_pairs.add(tuple(sorted((num, complement)))) checked_numbers.add(num) return list(unique_pairs) lst = [1, 2, 3, 4, 5, 6, 7, 8, 9] target result = 10 = find_pairslst, target) print(result) # [(1, 9), (2, 8), (3, 7), (4, 6) ] Bu kod find_pairs funksiyasini aniqlaydi, u butun sonlar ro'yxatini va maqsadli sonlar ro'yxatini qabul qiladi va<|eot_id|><|start_header_id|>user<|end_header_id|>

"Copy code" bog'lamasi ishlamayapti va oddiy ko'rinishda nusxa ko'chirishni sinab ko'rganda ishlamaydigan skript paydo bo'lmoqda.<|eot_id|>