From c2e3c35e60f9ca794b65b53b07c474ffb69a9d1b Mon Sep 17 00:00:00 2001 From: "Dawid J. Kubis" Date: Tue, 15 Oct 2019 23:54:14 +0200 Subject: [PATCH] lol, chybicka --- 3/fizzbuzz.oy | 0 3/fizzbuzz.py | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+) delete mode 100644 3/fizzbuzz.oy create mode 100644 3/fizzbuzz.py diff --git a/3/fizzbuzz.oy b/3/fizzbuzz.oy deleted file mode 100644 index e69de29..0000000 diff --git a/3/fizzbuzz.py b/3/fizzbuzz.py new file mode 100644 index 0000000..ee831f2 --- /dev/null +++ b/3/fizzbuzz.py @@ -0,0 +1,22 @@ + +# tahame hodnotu od uzivatele +lim = int(input('zadej cislo : ')) + +# prazny string +output = '' +# vsechna cisla do lim +for i in range(lim): + # reset promenny output + output = '' + + # pokud delitelne tremi + if i % 3 == 0: + output += 'fizz' + # pokud delitelne peti + if i % 5 == 0: + output += 'buzz' + + # zjistujeme jestli nam to + # stoji za to vypsat + if output != '': + print(output)