Python beginner questions
In an attempt to learn a little bit of Python 🐍, I was taking notes of some questions that popped into my mind.
Here they are, with a link for the corresponding answers, unfortunately in no particular order, but maybe still helpful 😅...
- How do I create static class variables and methods?
- What does the double and single asterisk mean?
- What's the simplest way to create an immutable data type?
- What is the meaning of single and double underscore before an property name?
- How to check for types?
- What is the Python exception hierarchy?
- Which version of Python the module
mypy
uses? - What's the scope of a variable initialized in an
if
statement? - How to use Python type hints?
- How to use assertions in Python?
- How to update a requirements file automatically when new packages are installed?
- How to create a
venv
with a different Python version? - How to exclude a folder from
mypy
checking? - How to make an immutable object in Python?
- How to hide stuff inside a package?
- What are the available interfaces to database packages in Python?
- Does Python have a ternary conditional operator?
- Why do you need explicitly have the
self
argument in a Python method? - What happens when using cyclic imports in Python?
- How can I create a copy of an object in Python?
- How do I convert a string to a number?
- How do I convert a number to a string?
- How to heck instances of classes?
- What is duck typing?
- What's the difference between abstract classes and interfacees in Python?
- How to understanding slicing?
- What are the fundamental types to master early on?
- What are list comprehensions?
- What is the Python equivalent for a
case/switch
statement? - How does Python's
super()
work with multiple inheritance? - How to format Python code to follow a consistent style guide
- Why do I need to care about WSGI (or ASGI)?
- Whatt are the most frequest questions about python