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

prvocisla-vypis.py

Blame
  • prvocisla-vypis.py 224 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
        while d < x:
            if x%d == 0:
                break
            d += 1
        else:
            print(x)
    
        x += 1