Skip to content
Snippets Groups Projects
Select Git revision
  • 2b433f3c2bd86e943094a39a6805d819f5ab6dce
  • master default
  • ls2021
  • ls1920
4 results

gen-k1.py

Blame
  • prvocisla-vypis.py 298 B
    #!/usr/bin/env python3
    # Vypíše všechna prvočísla od 1 do n
    
    n = int(input())
    
    x = 2
    while x <= n:
        d = 2
        mam_delitele = False
    
        while d < x:
            if x%d == 0:
                mam_delitele = True
                break
            d += 1
    
        if not mam_delitele:
            print(x)
    
        x += 1