DEV Community

Cover image for Intro to Python: Day 10 - Basic Operators in Python vs Javascript
James Hubert
James Hubert

Posted on

Intro to Python: Day 10 - Basic Operators in Python vs Javascript

Hi there 👋 I'm a New York City based web developer documenting my journey with React, React Native, and Python for all to see. Please follow my dev.to profile or my twitter for updates and feel free to reach out if you have questions. Thanks for your support!

As a developer with a basic background in Javascript, it can be confusing at times learning Python and completing exercises in a course because the syntax is so readable in Python, and so similar to JS, but not the same.

Every development language will have logical operators, and they will follow a simple AND, OR, NOT syntax.

In my native Javascript however, AND is demarcated with &&, OR is demarcated with || and NOT is demarcated with !. These are readable and short. They're so easy to get used to it can be tough to transition out, especially when Python's logical operators ==, !=, >, >= and so on are nearly identical to Javascript's.

In Python, those operators are simple English: and, or, not. They're so simple it's easy to forget them! Which is the easiest way to get a bug you have no idea how to solve.

Onward and upward!

If you like projects like this and want to stay up to date with more, check out my Twitter @stonestwebdev, I follow back! See you tomorrow for another project.

Top comments (0)