> For the complete documentation index, see [llms.txt](https://python.microcisco.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://python.microcisco.com/python-bootcamp/100-days/summary.md).

# SUMMARY

## <mark style="color:green;">DAY 1</mark>

### <mark style="color:purple;">String Manipulation:</mark>

Double & Single Quotes: \ <mark style="color:blue;">**`print('String concatenation is done with the "+" sign')`**</mark> ---> single then double then single \ <mark style="color:yellow;">String concatenation is done with the "+" sign</mark>\ <mark style="color:blue;">**`print("String concatenation is done with the \"+\" sign")`**</mark>---> double then ignore the double quotes as code, but keep it, add the +, ignore double quotes as code and keep the double quotes and end the double quotes.\ <mark style="color:yellow;">String concatenation is done with the "+" sign</mark><br>

### <mark style="color:purple;">New Lines and Multi-lines</mark>

<mark style="color:blue;">**`print("Hello World\nHello World\nHello World")`**</mark>  ---> \n places at the end of the word \ <mark style="color:yellow;">Hello Wallis</mark>\ <mark style="color:yellow;">Hello Wallis</mark>\ <mark style="color:yellow;">Hello Wallis</mark>\
\ <mark style="color:blue;">**`message = """This is a`**</mark>\ <mark style="color:blue;">**`multi-line string in Python"""`**</mark>\ <mark style="color:blue;">**`print(message)`**</mark>---> Triple double quotes <mark style="color:red;">**OR**</mark> triple single quotes to use multi-lines\ <mark style="color:yellow;">This is a</mark> \ <mark style="color:yellow;">multi-line string in Python</mark>\
\ <mark style="color:blue;">**`text = '''She said, "It's a great day!"'''`**</mark>---> Triple single quotes to avoid escape characters\ <mark style="color:yellow;">She said, "It's a great day!"</mark>

### <mark style="color:purple;">Concatenated</mark>

<mark style="color:blue;">**`print("Hello " + "Wallis, " + "How are you?")`**</mark>  ---> add space to get normal text\ <mark style="color:yellow;">Hello Wallis, How are you?</mark>\ <mark style="color:blue;">**`print("Hello" + " " + "Wallis," + " " + "How are you?")`**</mark>add a '+' sign between and double quotes\ <mark style="color:yellow;">Hello Wallis, How are you?</mark>

### <mark style="color:purple;">Input Functions</mark>

<mark style="color:blue;">**`print("Hello " + input("What is your name?"))`**</mark> ---to enter data into Python\ <mark style="color:blue;">**`print(len(input("What is your name?\n ")))`**</mark>\ <mark style="color:orange;">Wallis Short</mark>\ <mark style="color:yellow;">12</mark>

Actually the name has 11 characters. To remove the white space between

<mark style="color:blue;">**`name = input("What is your name?\n")`**</mark>\ <mark style="color:blue;">**`print(len(name.replace(" ", "")))`**</mark>\ <mark style="color:orange;">**Wallis Short**</mark>\ <mark style="color:yellow;">11</mark>

### <mark style="color:purple;">Variables</mark>

<mark style="color:blue;">**`name = input("What is your name?\n")`**</mark> \ <mark style="color:blue;">**`length = len(name.replace(" ", ""))`**</mark>\ <mark style="color:blue;">**`print(f"Hello {name}\nYour name has {length} characters in it")`**</mark>\ <mark style="color:yellow;">What is your name?</mark> \ <mark style="color:orange;">Leonardo da Vinci</mark> \ <mark style="color:yellow;">Hello Leonardo da Vinci</mark> \ <mark style="color:yellow;">Your name has 15 characters in it</mark>

#### <mark style="color:purple;">Variable Naming - PEP8</mark>

* OIL - nevewr use any of these as single character variable names (Uppercase O, Uppercase I or lowercase el )
* A-Z, a-z, 0-9 and undersocre \_ , all these can all be used in varaibles however a digit cannot be at the beginning
  * Most popular used are:
    * Camel Case - <mark style="color:red;">**camelCaseUsage**</mark> - First word is lowercase, and each following word starts with a capital letter.
    * Pascal Case - <mark style="color:red;">**PascalCaseUsage**</mark> - Every word starts with a capital letter (including the first one).
    * Snake Case - <mark style="color:red;">**snake\_case\_usage**</mark> - All letters are lowercase, words are separated by underscores.

{% hint style="success" %}
To check for reserved words, you can use:\ <mark style="background-color:green;">`help("keywords")`</mark>
{% endhint %}

#### **Which One Should You Use?**

🔹 **Python:** Use <mark style="color:blue;">`snake_case`</mark> for variables/functions, <mark style="color:blue;">`PascalCase`</mark> for classes.<br>

\=========================================================================

## <mark style="color:green;">DAY 2 - Data Types & String Manipulation</mark>

### <mark style="color:purple;">Data Types</mark>

* Strings
  * "Hello" is a string - think "string of pearls" - each letter joined with another letter to form a string of letters.
  * We can identify and pull out an individual letter within the string - called <mark style="color:red;">**SUBSCRIPTING**</mark> \ <mark style="color:blue;">**`print ("Hello" [1] )`**</mark>\ <mark style="color:yellow;">e</mark>\ <mark style="color:yellow;">The 'e' = position \[1]  - Left to Right (binary, start from 0)</mark>\ <mark style="color:yellow;">The 'e' = position \[-4] - Right to Left (no binary, start from 1)</mark>
* Integers - Whole Numbers
* Floats - Numbers with decimal points
* Boolean - True or False (Cpaital 'T' of 'F') - No quotes around them

### <mark style="color:purple;">Type Checking and Type Conversion</mark>

#### <mark style="color:purple;">Functions</mark>

* <mark style="color:blue;">**`num_char = len(input("What is your name? "))`**</mark>\ <mark style="color:blue;">**`print("Your name has " + num_char + "characters")`**</mark>
* <mark style="color:yellow;">What is your name?</mark>\ <mark style="color:orange;">Wallis</mark>\ <mark style="color:red;">print("Your name has " + num\_char + "characters")</mark> \ <mark style="color:red;">TypeError: can only concatenate str (not "int") to str</mark>
* From the below output we get a TypeError saying you cannot concatenate integers and strings but you can on strings only

#### <mark style="color:purple;">Type Checking</mark>

* <mark style="color:blue;">**`print(type(len(input("What is your name"))))`**</mark>\ <mark style="color:blue;">**`<class 'int'>`**</mark>---> Here we check what <mark style="color:green;">**TYPE**</mark> of class this is and it shows its an INTEGER

#### <mark style="color:purple;">Type Conversion</mark>

<mark style="color:blue;">**`num_char =`**</mark><mark style="color:green;">**`str`**</mark><mark style="color:blue;">**`(len(input("What is your name? ")))`**</mark> ---> here we change the int to a str\ <mark style="color:blue;">**`print("Your name has " + num_char + "characters")`**</mark>

<figure><img src="/files/hmt7XyWHREWaSEfL0cAU" alt=""><figcaption></figcaption></figure>

<mark style="color:blue;">`two_digit_number = input("Type in any 2 digit number:  \n")`</mark>\ <mark style="color:blue;">`first_number = two_digit_number [0]`</mark>---> this type is a 'string' as shown below\ <mark style="color:green;">`print(type(first_number)`</mark>\ <mark style="color:blue;">`second_number = two_digit_number [1]`</mark>---> this type is a 'string' as shown

<mark style="color:blue;">`print(int(first_number) + int(second_number))`</mark>---> convert strings to integers

<mark style="color:yellow;">Type in any 2 digit number:</mark>\ <mark style="color:orange;">35</mark> \ <mark style="color:green;">\<class 'str'></mark> shows us that this type is a 'string'\ <mark style="color:yellow;">8</mark>

### <mark style="color:purple;">Mathematical Operations</mark>

<mark style="color:purple;">Floor Division(//)</mark>

* Floor division divides 2 numbers and returns the LARGEST integer less than or equal to the result, ie, it rounds down the result to the nearest WHOLE number.
  * <mark style="color:blue;">**`7//2 # Result 3`**</mark> <mark style="color:red;">---> this gives 3 because that's the largest integer less than or = to 3,5</mark>\ <mark style="color:blue;">**`-7//2 #Result: -4 (rounded DOWN )`**</mark>-<mark style="color:red;">--> rounds down to the lower integer with negative numbers</mark>

<mark style="color:purple;">Quotient</mark>

* The quotient refers to the integer part of a division result, ignoring the remainder. Its the same as floor division

<mark style="color:purple;">Remainder (%) Modulo</mark>

* The **modulo operator** is carried out with a percent symbol (%) and is used to get the <mark style="color:red;">remainder</mark> of a division.\
  **For example:**
  * <mark style="color:blue;">**`print(20 % 6)`**</mark>\ <mark style="color:blue;">**`20 // 6 = 3`**</mark> \ <mark style="color:blue;">**`3*6 = 18`**</mark>\ <mark style="color:blue;">**`20-18 = 2`**</mark> \ <mark style="color:blue;">**`Modulo = 2.0`**</mark>

    \ <mark style="color:blue;">**`print(1.25 % 0.5)`**</mark> \ <mark style="color:blue;">**`1.25 // 0.5 = 2.0`**</mark> \ <mark style="color:blue;">**`2.0 * 0.5 = 1.0`**</mark> \ <mark style="color:blue;">**`1.25 -1 = 0.25`**</mark> \ <mark style="color:blue;">**`Modulo = 0.25`**</mark><br>

    <mark style="color:blue;">**`print(12 % 4.5)`**</mark>\ <mark style="color:blue;">**`12 // 4.5 = 2.0`**</mark> \ <mark style="color:blue;">**`2 * 4.5 = 9.0`**</mark> \ <mark style="color:blue;">**`12 - 9.0 = 3.0`**</mark>\ <mark style="color:blue;">**`Modulo = 3.0`**</mark>\
    **Remember integer divided by a float is always a float !!**

### <mark style="color:purple;">**Operators and their Binding**</mark>  <a href="#operators-and-their-binding" id="operators-and-their-binding"></a>

Don't forget **PEMDAS**\
**(Parentheses, Exponents, Multiplication and Division, Addition and Subtraction)**\
**We do this fro&#x20;**<mark style="color:green;">**LEFT to RIGHT**</mark>\
\ <mark style="color:blue;">**`print(9 % 6  %  2)`**</mark> **---> starting from left hand side like PEMDAS**\ <mark style="color:green;">**9 // 2 = 4.0**</mark>\ <mark style="color:green;">**4 \* 2 = 8**</mark>\ <mark style="color:green;">**9 - 8 = 1 .0**</mark>\ <mark style="color:green;">**so:**</mark>\
&#x20;    <mark style="color:green;">**print(1  % 2)**</mark>\
&#x20;    <mark style="color:green;">**1 //2 = 0.5**</mark>\
&#x20;    <mark style="color:green;">**0.5 \* 2 = 1**</mark>\ <mark style="color:green;">**Modulo = 1**</mark>**&#x20;----> not sure why this is an integer and not a float**\
&#x20;**because if I do**\
\ <mark style="color:green;">**print(type(9 % 6 % 2))**</mark>\ <mark style="color:yellow;">\<class 'int'></mark><br>

<br>
