1 of 17

Slide Notes

DownloadGo Live

Python Vs JavaScript

Published on Nov 30, 2015

No Description

PRESENTATION OUTLINE

PYTHON VS JAVASCRIPT

Created by Karmen Lawson
Photo by tinyfroglet

Python
Python is much less complicated than JavaScript and much easier to understand.

Photo by Terriko

For example, in JavaScript, if you want to define a variable, you have to type:

var Example = 6

Something along those lines.
In Python, you don't have to use the command var;

Photo by geroyche

Example = 8

Photo by srdgato_

Python's data types don't use the concept of 'mutability'. Some data types cannot be modified;

Photo by tinyfroglet

Any modification returns a new value, but does not modify the value in the original variable.

Photo by kestrana

Other types, like lists, can be modified in place.
In general, it's not necessary to think about this distinction when writing Python code;

Photo by LJWDevon

The various types behave as one would intuitively expect. JavaScript, on the other hand, has no concept of mutable vs. immutable.

JavaScript:
In JavaScript, you often have to use two parentheses () at the end of a line to make if work.
You also need a lot of brackets.

Photo by peasap

In Python, you don't.

Photo by Terriko

In Python, you don't use nearly as many.
In JavaScript, there are two ways to create a new identifier.

Photo by Will Montague

The keyword function foo(…) {} declares a new function, and the var keyword declared a new variable.

Photo by Terriko

Variable declarations do not need initial values: var foo; means foo gets the initial value of undefined.

As you see, Python and JavaScript are two very different ways of coding.
They have many differences, but are pretty much used for a lot of the same things.

Photo by vociferous.

THANKS FOR WATCHING

Merci boku ✨
Photo by harold.lloyd