Python for JavaScript Developers

Python for JavaScript Developers

1h 58mIntermediate2021-02-22

Authors

Ronnie Sheer

Ronnie Sheer

Software Developer and Instructor

Course details

Do you need to learn Python for your current job, for the job you want, or just for fun? In this course, instructor Ronnie Sheer shows you how you can leverage your existing knowledge of JavaScript to get started programming in Python. Ronnie compares Python and JavaScript, then covers how to set up and run a Python environment. He discusses how to write code that adheres to Python conventions, which can prevent bugs. Ronnie explains some of the basic logic in Python, including the use of indentation, how to write and debug control flow, how to use Python try/except appropriately, and more. He goes over objects and class definitions, then explores Python’s data model feature and mixins class. Ronnie goes into iteration in Python and shows how you can write more concise and elegant code in Python by using zip, enumerate, and list comprehensions. He concludes with a challenge that shows you how to apply your knowledge of JavaScript and Python to improve a small program.

Skills covered

PythonProjectProgramming LanguagesOpen SourceSoftware Development

Concepts

Introduction

  • Using your JavaScript knowledge to learn Python
  • What you should know

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

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

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

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

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
40,000 Toman