Predict the outputIntermediate30 XPExercise 6/6
try, except, else, finally
Task
Without running the program, write exactly what it prints. Mind the order of the outputs!
def delenie(a, b):
try:
vysledok = a // b
except ZeroDivisionError:
print("delenie nulou")
return None
else:
print("ok")
return vysledok
finally:
print("koniec")
print(delenie(7, 2))
print(delenie(1, 0))
Your answer
Put each printed line on its own line.
Hints
Try it yourself first. Each hint reveals a little more - and lowers the reward a little.
Signed out, hints are free - but no XP is awarded either.
Solution
The solution unlocks after the last hint.