for_else
This commit is contained in:
23
dzien_02/skrypt_05.py
Normal file
23
dzien_02/skrypt_05.py
Normal file
@@ -0,0 +1,23 @@
|
||||
nasze_dane = ( 23, 44, 55, 44, 34, 76, 87)
|
||||
|
||||
for element in nasze_dane:
|
||||
if type(element) is str:
|
||||
break
|
||||
wynik = round(element / 6,3)
|
||||
print(f"Wynik dzielenia to {wynik}")
|
||||
|
||||
else:
|
||||
print("Wszystko ok")
|
||||
|
||||
##
|
||||
|
||||
nasze_dane = ( 23, 44, 55, 44,"A", 34, 76, 87)
|
||||
|
||||
for element in nasze_dane:
|
||||
if type(element) is str:
|
||||
continue
|
||||
wynik = element / 6
|
||||
print(f"Wynik dzielenia to {wynik}")
|
||||
|
||||
else:
|
||||
print("Wszystko ok, nawet gdy continue")
|
||||
Reference in New Issue
Block a user