<commit_before># Python

* `Python` is a **Dynamically Typed** as well as **Strongly Typed** Language.

* `Dynamically Typed` : *Type* tracking is done automatically instead of manually typing the object types (like in `C++`)

* `Strongly Typed` : An object of a particular *type* can only do operations linked to that type (a *string* can only perform string-operations not *list*-operations)

* `Modules` are just packages of additional tools that we `import` to use.

* `strings` are sequences of one-character strings.

* Other more general sequence types include: `lists` and `tuples`.

* In Python, we can also index backwards from end. Positive indexes counts from the left while Negative indexes counts backwards from the right.

* **Immutable Objects** : `numbers`, `strings`, `tuples`

* **Mutable Objects** : `lists`, `dictionaries`, `sets`.

### Numeric Literals:

* In **Python 2.X** :
	* Two `integer` types : 
		* `normal`	: 32 bits
		* `long`	: unlimited precison
	* Python automatically converts up to `long` integer type when extra precision is needed

* In **Python 3.X** : 
	* Only 1 `integer` type: unlimited precision

* `is` operator tests object identity (i.e. address in memory)

* `lambda` creates un-named functions.

``` Python
# Python Expression Operators and Precedence

yield x 			# Generator function send protocol
lambda args : expression 	# Anonymous function generation

x if y else z			# Ternary selection (x is evaluated only if y is True)

x or y 				# Logical OR (y is evaluated only if x is False)
x and y 			# Logical AND (y is evaluated only if x is True)
not x 				# Logical Negation

x in y 				# Membership (iterables, sets)
x not in y 			# Membership (iterables, sets)

x is y 				# Object identity tests
x is not y 			# Object identity test

```

* `Polymorphism` : Meaning of an operation depends on the type of the `object` being operated on.

* **Variables** : 
	* Variables are created when they are first assigned values
	* Variables are replaced with values when they are first used in expressions
	* Variables must be assigned before they can be used in expressions
	* **Variables refer to objects and are never declared ahead of time**

<commit_msg>division rules in 2.X v/s 3.X<commit_after># Python

* `Python` is a **Dynamically Typed** as well as **Strongly Typed** Language.

* `Dynamically Typed` : *Type* tracking is done automatically instead of manually typing the object types (like in `C++`)

* `Strongly Typed` : An object of a particular *type* can only do operations linked to that type (a *string* can only perform string-operations not *list*-operations)

* `Modules` are just packages of additional tools that we `import` to use.

* `strings` are sequences of one-character strings.

* Other more general sequence types include: `lists` and `tuples`.

* In Python, we can also index backwards from end. Positive indexes counts from the left while Negative indexes counts backwards from the right.

* **Immutable Objects** : `numbers`, `strings`, `tuples`

* **Mutable Objects** : `lists`, `dictionaries`, `sets`.

### Numeric Literals:

* In **Python 2.X** :
	* Two `integer` types : 
		* `normal`	: 32 bits
		* `long`	: unlimited precison
	* Python automatically converts up to `long` integer type when extra precision is needed

* In **Python 3.X** : 
	* Only 1 `integer` type: unlimited precision

* `is` operator tests object identity (i.e. address in memory)

* `lambda` creates un-named functions.

``` Python
# Python Expression Operators and Precedence

yield x 			# Generator function send protocol
lambda args : expression 	# Anonymous function generation

x if y else z			# Ternary selection (x is evaluated only if y is True)

x or y 				# Logical OR (y is evaluated only if x is False)
x and y 			# Logical AND (y is evaluated only if x is True)
not x 				# Logical Negation

x in y 				# Membership (iterables, sets)
x not in y 			# Membership (iterables, sets)

x is y 				# Object identity tests
x is not y 			# Object identity test

```

* `Polymorphism` : Meaning of an operation depends on the type of the `object` being operated on.

* **Variables** : 
	* Variables are created when they are first assigned values
	* Variables are replaced with values when they are first used in expressions
	* Variables must be assigned before they can be used in expressions
	* **Variables refer to objects and are never declared ahead of time**

* `Classic Division ( X / Y )` : In `Python 2.X`, Truncating results for `integers` and keeping the remainders (i.e. fractional parts) for the `floating-point numbers`

* `True Division ( X / Y )` : In `Python 3.X`, ALWAYS keeping remainders in floating-point results regardless of the types.

* `Floor Division ( X // Y )` : In `Python 2.X & 3.X`, Always truncates fractional remainders down to their floors regardless of the types. Its result type depends on the type of its operands






{'fraction_non_alphanumeric': 0.08887533048606874, 'fraction_numerical': 0.003254016676835469, 'mean_word_length': 3.8741328047571852, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '551443', 'n_tokens_mistral': 1502, 'n_tokens_neox': 1389, 'n_words': 696}