Skip to content
Snippets Groups Projects
Select Git revision
  • 508d48077d0cb64a74c05aa494c1fdef7d790747
  • master default
  • zs2021
  • zs1920
4 results

prvocisla-vypis.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