Be careful when copying Lists!
If you don't know whats happening in the code snippet, read this:
How to copy a List in Python without side effects
python-engineer.com/posts/ho…
How to check if a List is empty in Python:
- if not my_list
- if len(my_list == 0)
Which option do you prefer?
The official PEP 8 Style Guide recommends option 1.
Read more here: python-engineer.com/posts/ch…
Python Tip:
Python has an interactive mode that you can use with
python -i
It runs the script and then starts the interactive shell with access to all variables/functions etc. Very cool for debugging or tinkering around with your script.🐍