Introduction
Using your JavaScript knowledge to learn Python
()
What you should know
()
1. Tools of the Trade
Comparing the Python ecosystem to the JavaScript universe
()
Setting up an environment with Python, pip or Pipenv, and Node.js
()
Running Python programs
()
Debugging Python with ipdb
()
Challenge: Hello Python/JS ninja
()
Solution: Hello Python/JS ninja
()
2. The First Steps
Why style is crucial
()
Numbers, numeric types, and decimals
()
Migrating from arrays to Python lists, tuples, and dictionaries
()
Strings and formatting: Python vs. JavaScript
()
Python slices
()
Challenge: Port the code
()
Solution: Port the code
()
3. Basic Logic
Braces
()
Control flow in Python
()
How iteration differs between Python and JavaScript
()
Why try/except is everywhere
()
Challenge: Porting the greeting
()
Solution: Porting the greeting
()
4. Classes, Inheritance, and the Mighty Data Model
Objects in Python vs. JavaScript
()
Class definition in Python
()
Super powers with the data model
()
Understanding inheritance and mixins
()
Challenge: Enhancing endpoints with mixins
()
Solution: Enhancing endpoints with mixins
()
5. Advance Iterations and Comprehensions
Iterating in Python
()
Writing concise code with zip and enumerate
()
From JavaScript map and filter to an elegant Python comprehensions
()
Decorators are essential
()
Challenge: Map to comprehension
()
Solution: Map to comprehension
()
Conclusion
More Python resources
()
Ex_Files_Python_JavaScript.zip
(286 KB)