i have this function that works as intended except for the fact that the last print instruction outside the while cycle (print("why don't you print?")) never get executed and i don't understand why. after the break, the code execution should move forward.
def eval_cycle():
done = 'done'
last_expression = ' '
while True:
dato = eval(input('Insert an expression: '))
if dato == done:
print("Last expression is: ", last_expression)
return dato
break
last_expression = dato
print(dato)
print("why don't you print?")
returnreturns immediately, beforebreakcan execute.