Is hilarious mistake in Python design. Thanks @elfprince13.
```python
def x():
e = None
while e is None:
try: print(input("? "))
except Exception as e: print(repr(e))
x()
```
Result:
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 3, in x
UnboundLocalError: local variable 'e' referenced before assignment
```
@radehi @elfprince13 none will be able to appreciate the code you've shared if you don't post it indented, so we can reproduce. I'd suggest you to use a website like pastebin for this. Python without indentation is impossible to read...
@mlliarm @radehi happily my OP has a link to replit https://mumak.app/@elfprince13/109382319882403287
@mlliarm @elfprince13 The problem is not that a function has side effects.
@radehi @elfprince13 Okay, thanks