From 6a4be1cc87c9338e03b5a98e318721e13d249069 Mon Sep 17 00:00:00 2001 From: Martin Mares <mj@ucw.cz> Date: Tue, 15 Oct 2024 15:34:08 +0200 Subject: [PATCH] =?UTF-8?q?Seznamy:=20P=C5=99=C3=ADklad=20s=20hled=C3=A1n?= =?UTF-8?q?=C3=ADm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 03-seznamy/hledani.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 03-seznamy/hledani.py diff --git a/03-seznamy/hledani.py b/03-seznamy/hledani.py new file mode 100755 index 0000000..f51a77b --- /dev/null +++ b/03-seznamy/hledani.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 +# Načítá čísla ze vstupu ukončená -1 +# a pak v nich hledá. + +seznam = [] + +while True: + x = int(input()) + if x == -1: + break + seznam.append(x) + +while True: + y = int(input()) + if y == -1: + break + + nasel = False + for x in seznam: + if x == y: + print('ANO') + nasel = True + + if not nasel: + print('NE') -- GitLab