Bu yerda Eratosthenesning Sieve Python-ning amalga oshirilishi, bu ma'lum bir chegaradan barcha bos sonlarni topish uchun algoritmdir: ``python def sieve ((n: int) -> list[int]: """Eratosthenesning Sieve-ni hisoblaydi, barcha bos sonlar ro'yxatini qaytaradi (n) " bos sonlar = [True] * n uchun i oralig'ida (n) "": if primes[i]: # Iterate over multiples of i and mark them as non-prime for k in ((i*2, n, i): primes[k] = False # Return all indices marked as primes (except for 1, which is a special case) [i for i in range (n) if primes]] ``
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence