1 + 2

1 + 2;



1 + 2.0

1 + 2.0;



1 + "a"



"a" + "b"
[1] + [2]
(1, 2) + (3, 4)



1 + "a";
1 + null;
1 + undefined;
1 + true;
1 + false;
1 + [2];
1 + {};



"a" + "b";
"a" + null;
"a" + undefined;
"a" + true;
"a" + false;
"a" + [1];
"a" + {};



null + false;



[1, 2] + null;



2 - 1
{1, 2} - {2, 3}



2 - 1;
1 - null;
[1, 2] - [2];
"abc" - "ab";



2 * 3
"abc" * 2
[1, 2] * 2
(1, 2) * 2
[1, 2] * 0
(1, 2) * 0



x = [3, 1, 2]
y = [x] * 2
x.sort()
y



3.5 * 2;
"3.5" * "2";
3.5 * true;
3.5 * "";
[3.5] * 2;



[3.5, 2] * 2;
3.5 * "true";



4 / 2
3 / 1.5
3 / 2
3 / 0



5 // 2
4 // 2
3 // 0



4 / 2;
3 / 2;
3 / 0;
3 / (-0);



Math.floor(5 / 2);
Math.floor(4 / 2);
Math.floor(3 / 2);
Math.floor(4 / 0);



3 % 2
3 % 0

3 % 2;
3 % 0;



2 ** 3
2 ** 0
2 ** -1
2 ** 0.5

2 ** 3;
2 ** 0;
2 ** -1;
2 ** 0.5;



1 > 2 

1 > 2;



1 == 1
"abc" == "abc"
[1, 2] == [1, 2]
{"a": 1, "b": 2} == {"b": 2, "a": 2}



1 != 1



x = [1, 2]
y = x
x is y



z = [1, 2]
x is z
x == z



id(x)
id(y)
id(z)



x is not z
x is not y



1 == 1;
"abc" == "abc";
[1, 2] == [1, 2];
{a:1} == {a:1};



1 == "1";
1 == [1];
1 == ["1"];
1 == true;
"1" == [1];



if (x == 1) {
    y = 1 + x;
}



1 === 1;
1 === "1";
1 === [1];
1 === true;



x = [1, 2];
y = [1, 2];
x === y;
JSON.stringify(x);
JSON.stringify(x) === JSON.stringify(y);
a = { s: 1 };
b = { s: 1 };
a === b;
JSON.stringify(a);
JSON.stringify(a) === JSON.stringify(b);



x = {};
x.a = 1;
x.b = 2;
x;
y = {};
y.b = 2;
y.a = 1;
y;
JSON.stringify(x);
JSON.stringify(y);
JSON.stringify(a) === JSON.stringify(b);
x = { a: 1, b: 2 };
y = { b: 2, a: 1 };
JSON.stringify(x);
JSON.stringify(y);
JSON.stringify(a) === JSON.stringify(b);



1 != 2; 
1 !== 2;



x = 5
1 < x < 10 
6 < x < 10 
1 < x < 4



x == y == z



x = 1
y = 2
x == 1 and y == 2
x == 0 and y == 2

x = 1;
y = 2;
x === 1 && y === 2;
x === 0 && y === 2;



x = 1
y = 2
x == 1 or y == 0 

x = 1;
y = 2;
x === 1 || y === 0;



x = 1
not x == 1
not x == 0

x = 1;
!(x === 1);
!(x === 0);



x = 1;
!x === 1;
!x === 0;



false === 0;



x = 1;
x ?? 10;
x = null;
x ?? 10;



1 || 10;
null || 10;



x = 0;
x ?? 10;
x || 10;
x = "";
x ?? 10;
x || 10;



x = 1;
x === 1 ? 10 : 20;
x === 2 ? 10 : 20;



x = 1
10 if x == 1 else 20
10 if x == 2 else 20



10 if x == 2 else 20 if x == 3 else 30



10 if x == 2 else (20 if x == 3 else 30)



x = [1, 2];
[a, b] = x;



x = [1, 2, 3, 4];
[a, b, ...c] = x;



x = [1, 2];
[z] = x;
[a, b, c] = x;



x = {a: 1, b: 2};
{a, b} = x;



x = {a: 1, b: 2, c: 3, d: 4};
{a, b, ...rest} = x;



x = [1, 2]
a, b = x



x = [1, 2, 3]
a, b = x



x = [1, 2, 3, 4]
a, b, *c = x



lst = [1, 2, 3]
len_lst = len(lst)
if len_lst >= 2:
    print(len_lst)



lst = [1, 2, 3]
if len(lst) >= 2:
    print(len(lst))



lst = [1, 2, 3]
if (len_lst := len(lst)) >= 2:
    print(len_lst)



lst = [1, 2, 3]
if (len_lst = len(lst)) >= 2:
    print(len_lst)



x = 1;
x++; 
x;




