Skip to content
Snippets Groups Projects
Select Git revision
  • zs1920
  • master default
  • zs2021
3 results

prvocisla-test.py

Blame
  • Martin Mares's avatar
    Martin Mareš authored
    Též přesunuty příklady, které přetekly z 01.
    7fbad72b
    History
    prvocisla-test.py 305 B
    #!/usr/bin/env python3
    # Otestuje, zda číslo je prvočíslem
    
    n = int(input())
    d = 2
    mam_delitele = False
    
    while d < n:
        if n%d == 0:
            print("Číslo", n, "je dělitelné", d)
            mam_delitele = True
            break
        d += 1
    
    if not mam_delitele:
        print("Číslo", n, "je prvočíslo")