Fixes syntax issues that cause issues when running as a Python file

1. Use only already declared variables in example # some_var = a if a > b else b
2. Catch KeyError in dict example
3. Use a already defined function name in args, kwargs example.