Swapna Kumar Panda
Swapna Kumar Panda

@swapnakpanda

23 Tweets Mar 23, 2023
With a combined market share of 40%, it brings enormous opportunities when you skill yourself in both Python and JavaScript.
Here's how I did it in a quick time:
โฌ˜ First, I skilled myself in one language (JavaScript).
โฌ— Once I became familiar, I decided to learn the other one (Python).
โฌ™ While learning Python, I compared its syntax with JavaScript's to quickly learn it.
This whole method really paid off. Let's have some samples.
โžŠ Variables
โž€ Variable Naming
โž Variable Declaration
โž‚ Variable Assignment
โžŠ.โž€ Variable Naming
โฌ˜ Python and JavaScript are almost similar in variable naming conventions except that JavaScript allows $ in variable names.
โฌ™ Python has a convention of using snake_case while JavaScript prefers camelCase naming.
โžŠ.โž Variable Declaration
โฌ˜ Python doesn't have any syntax to declare a variable while JavaScript has 3 keywords.
โฌ— Type Declaration: Python introduced it in v3.5, but doesn't enforce it. JavaScript doesn't have any.
โฌ™ Both allow changing the variable type dynamically.
โžŠ.โž‚ Variable Assignment
Both Python and JavaScript have multiple syntaxes for assigning values to variables.
โž‹ Data Types
โž€ Built-In Data Types
โž Finding Type
โž‚ Checking Instance Type
โžƒ Type Casting
โž‹.โž€ Built-In Data Types
โฌ˜ Both Python and JavaScript provide some common data types.
โฌ™ Each has its own set of unique featured data types.
โž‹.โž Finding Type
โฌ˜ As both Python and JavaScript are dynamically typed, finding the type of a variable at runtime is a common practice.
Both provide a way to do this.
โž‹.โž‚ Checking Instance Type
โฌ˜ On some occasions, we need to check if a variable is of a particular type or not.
Both Python and JavaScript have options to do this.
โž‹.โžƒ Type Casting
โฌ˜ Data sometimes come in different formats and need to be converted to appropriate types at run-time.
Both Python and JavaScript support typecasting.
โžŒ Operators
โž€ Arithmetic Operators
โž Comparison Operators
โž‚ Logical Operators
โžƒ Bitwise Operators
โž„ Assignment Operators
โž… Ternary Operator
โž† Membership Operators
โž‡ Type Checking Operators
โžˆ Operator Overloading
โžŒ.โž€ Arithmetic Operators
โžŒ.โž Comparison Operators
โžŒ.โž‚ Logical Operators
โžŒ.โžƒ Bitwise Operators
โžŒ.โž„ Assignment Operators
โžŒ.โž… Ternary Operator
โฌ˜ JavaScript has a ternary operator ?:
โ‡ฅ x > 5 ? 2 : 4
โฌ™ Though Python doesn't have any such operator, it has similar functionality.
โ‡ฅ 2 if x > 5 else 4
โžŒ.โž† Membership Operators
โฌ˜ Python provides 2 membership operators ("in" and "not in") that check whether an element exists in a sequence (list, tuple, etc).
โฌ™ JavaScript has an "in" operator which is used inside for..in loop and for object property checks.
โžŒ.โž‡ Type Checking Operators
โฌ˜ JavaScript provides 2 type checking operators (typeof and instanceof). It's discussed in โž‹.โž & โž‹.โž‚.
โฌ™ Python doesn't have any equivalent operators. But it provides 2 functions to do these. type() and isinstance()
โžŒ.โžˆ Operator Overloading
โฌ˜ Python allows operator overloading. Python doesnโ€™t do type conversion during evaluation.
โฌ™ JavaScript doesnโ€™t have support for operator overloading. It auto-converts the operands to the required type during evaluation.
๐Ÿšฅ Disclaimer
I have tried to show a way of learning multiple languages at the same time by comparing their syntax.
Hey ๐Ÿ‘‹
I am a Tech Educator and, Writer from India ๐Ÿ‡ฎ๐Ÿ‡ณ
I am sharing Tutorials, Practice Questions, Project Ideas, Roadmaps on Python, JavaScript, DSA, and Databases.
โžŸ To never miss anything, Follow Me โœ…
โžŸ RT the below tweet to share in your circle.

Loading suggestions...