This commit is contained in:
2025-12-16 12:29:11 +01:00
parent 29bb9621f8
commit 8226b26a44
2 changed files with 40 additions and 1 deletions

View File

@@ -28,4 +28,21 @@ else:
# przed pętlą zrób listę wyniki = []
# napisz pętlę for, a w bloku kodu zrób tak:
# jeśli element to str lub int, to dodaj go do listy wyniki
# na końcu pętli wyświel wyniki
# na końcu pętli wyświel wyniki
# jedno z możliwych rozwiązań:
nasze_dane = (1,2, "Linux", True, 3.44, "Adam")
wyniki = []
for element in nasze_dane:
# if type(element) is str or type(element) is int:
# wyniki.append(element)
if type(element) is str:
wyniki.append(element)
elif type(element) is int:
wyniki.append(element)
print(wyniki)