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

prvocisla-test.py

Blame
  • 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")