Skip to content

Commit

Permalink
Merge pull request #113 from 42-AI/dev
Browse files Browse the repository at this point in the history
Merging since it's pending for months.
  • Loading branch information
matboivin authored Oct 25, 2020
2 parents 9311fdb + 7d37a52 commit 72a2af1
Show file tree
Hide file tree
Showing 44 changed files with 320 additions and 254 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,8 @@ No prior Python programming or Machine Learning experience is required! Your mis
* Quentin Bragard ([email protected])
* Marie Dufourq ([email protected])
* Adrien Vardon ([email protected])

### Thanks to Ilyes and Kévin for the PR

* Ilyes Bouchlaghem ([email protected])
* Kévin Azoulay-Dessus ([email protected])
Binary file modified day00.pdf
Binary file not shown.
26 changes: 13 additions & 13 deletions day00/ex00/ex00.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

| | |
| -----------------------:| ------------------ |
| Turn-in directory : | ex00 |
| Files to turn in : | answers.txt, requirements.txt |
| Forbidden functions : | None |
| Remarks : | n/a |
| Turn-in directory: | ex00 |
| Files to turn in: | answers.txt, requirements.txt |
| Forbidden functions: | None |
| Remarks: | n/a |

The first thing we need to do is install Python.
The first thing you need to do is install Python.

## Conda manual install

Expand All @@ -27,28 +27,28 @@ sh Miniconda3-latest-MacOSX-x86_64.sh -b -p <path>

The goinfre will change depending on your desktop location in cluster, so you will need to reinstall everything.

3. Install needed requirements.
3. Add export to your `.zshrc` file.

```bash
conda install -y "jupyter" "numpy" "pandas"
export PATH=$MINICONDA_PATH:$PATH
```

4. Add export to your `.zshrc` file.
4. Source your `.zshrc` file.

```bash
export PATH=$MINICONDA_PATH:$PATH
source ~/.zshrc
```

5. Source your `.zshrc` file.
5. Check your Python environment.

```bash
source ~/.zshrc
which python
```

6. Check your Python environment.
6. Install needed requirements.

```bash
which python
conda install -y "jupyter" "numpy" "pandas"
```

Your Python should now be the one corresponding to the miniconda environment!
Expand Down
14 changes: 8 additions & 6 deletions day00/ex01/ex01.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@

| | |
| -----------------------:| ------------------ |
| Turn-in directory : | ex01 |
| Files to turn in : | exec.py |
| Forbidden functions : | None |
| Remarks : | n/a |
| Turn-in directory: | ex01 |
| Files to turn in: | exec.py |
| Forbidden functions: | None |
| Remarks: | n/a |

You will have to make a program that reverses the order of a string and the case of its words.
If we have more than one argument we have to merge them into a single string and separate each arg by a ' ' (space char).
If we have more than one argument we have to merge them into a single string and separate each arg by a ' ' (space char).

**Example:**

```console
> python exec.py "Hello World!" | cat -e
> python exec.py "Hello World\!" | cat -e
!DLROw OLLEh$
> python exec.py "Hello" "my Friend" | cat -e
DNEIRf YM OLLEh$
Expand Down
10 changes: 6 additions & 4 deletions day00/ex02/ex02.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

| | |
| -----------------------:| ------------------ |
| Turn-in directory : | ex02 |
| Files to turn in : | whois.py |
| Forbidden functions : | None |
| Remarks : | n/a |
| Turn-in directory: | ex02 |
| Files to turn in: | whois.py |
| Forbidden functions: | None |
| Remarks: | n/a |

You will have to make a program that checks if a number is odd, even or zero.
The program will accept only one parameter, an integer.

**Example:**

```console
> python whois.py 12
I'm Even.
Expand Down
12 changes: 7 additions & 5 deletions day00/ex03/ex03.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@

| | |
| -----------------------:| ------------------ |
| Turn-in directory : | ex03 |
| Files to turn in : | count.py |
| Forbidden functions : | None |
| Remarks : | n/a |
| Turn-in directory: | ex03 |
| Files to turn in: | count.py |
| Forbidden functions: | None |
| Remarks: | n/a |

Create a function called `text_analyzer` that displays the sums of upper-case characters, lower-case characters, punctuation characters and spaces in a given text.

`text_analyzer` will take only one parameter: the text to analyze. You have to handle the case where the text is empty (maybe by setting a default value). If there is no text passed to the function, the user is prompted to give one.

Test it in the Python console:
Test it in the Python console.

**Example:**

```console
> python
Expand Down
10 changes: 6 additions & 4 deletions day00/ex04/ex04.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

| | |
| -----------------------:| ------------------ |
| Turn-in directory : | ex04 |
| Files to turn in : | operations.py |
| Forbidden functions : | None |
| Remarks : | n/a |
| Turn-in directory: | ex04 |
| Files to turn in: | operations.py |
| Forbidden functions: | None |
| Remarks: | n/a |

You will have to make a program that prints the results of the four elementary mathematical operations of arithmetic (addition, subtraction, multiplication, division) and the modulo operation. This should be accomplished by writing a function that takes 2 numbers as parameters and returns 5 values, as formatted in the console output below.

**Example:**

```console
> python operations.py 10 3
Sum: 13
Expand Down
8 changes: 4 additions & 4 deletions day00/ex05/ex05.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

| | |
| -----------------------:| ------------------ |
| Turn-in directory : | ex05 |
| Files to turn in : | kata00.py, kata01.py, kata02.py, kata03.py, kata04.py |
| Forbidden functions : | None |
| Remarks : | n/a |
| Turn-in directory: | ex05 |
| Files to turn in: | kata00.py, kata01.py, kata02.py, kata03.py, kata04.py |
| Forbidden functions: | None |
| Remarks: | n/a |

Let's get familiar with the useful concept of **string formatting** through a kata series.

Expand Down
11 changes: 6 additions & 5 deletions day00/ex06/ex06.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

| | |
| -----------------------:| ------------------ |
| Turn-in directory : | ex06 |
| Files to turn in : | recipe.py |
| Forbidden functions : | None |
| Remarks : | n/a |
| Turn-in directory: | ex06 |
| Files to turn in: | recipe.py |
| Forbidden functions: | None |
| Remarks: | n/a |

It is time to discover Python dictionaries. Dictionaries are collections that contain mappings of unique keys to values.
*Hint: check what is a nested dictionary in Python.*

***Hints:*** check what is a nested dictionary in Python.

First, you will have to create a cookbook dictionary called `cookbook`.

Expand Down
10 changes: 6 additions & 4 deletions day00/ex07/ex07.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

| | |
| -----------------------:| ------------------ |
| Turn-in directory : | ex07 |
| Files to turn in : | filterwords.py |
| Forbidden functions : | filter |
| Remarks : | n/a |
| Turn-in directory: | ex07 |
| Files to turn in: | filterwords.py |
| Forbidden functions: | filter |
| Remarks: | n/a |

Using list comprehensions, you will have to make a program that removes all the words in a string that are shorter than or equal to n letters, and returns the filtered list with no punctuation.
The program will accept only two parameters: a string, and an integer n.

**Example:**

```console
> python filterwords.py "Hello, my friend" 3
['Hello', 'friend']
Expand Down
10 changes: 6 additions & 4 deletions day00/ex08/ex08.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

| | |
| -----------------------:| ------------------ |
| Turn-in directory : | ex08 |
| Files to turn in : | sos.py |
| Forbidden functions : | None |
| Remarks : | n/a |
| Turn-in directory: | ex08 |
| Files to turn in: | sos.py |
| Forbidden functions: | None |
| Remarks: | n/a |

You will have to make a function which encodes strings into Morse code.
The input will accept all alphanumeric characters.

**Example:**

```console
> python sos.py "SOS"
... --- ...
Expand Down
9 changes: 5 additions & 4 deletions day00/ex09/ex09.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

| | |
| -----------------------:| ------------------ |
| Turn-in directory : | ex09 |
| Files to turn in : | guess.py |
| Forbidden functions : | None |
| Remarks : | n/a |
| Turn-in directory: | ex09 |
| Files to turn in: | guess.py |
| Forbidden functions: | None |
| Remarks: | n/a |

You will have to make a program that will be an interactive guessing game. It will ask the user to guess a number between 1 and 99. The program will tell the user if their input is too high or too low. The game ends when the user finds out the secret number or types `exit`.
You will have to import the `random` module with the `randint` function to get a random number.
You have to count the number of trials and print that number when the user wins.

**Example:**

```console
> python guess.py
Expand Down
8 changes: 4 additions & 4 deletions day00/ex10/ex10.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

| | |
| -----------------------:| ------------------ |
| Turn-in directory : | ex10 |
| Files to turn in : | loading.py |
| Forbidden functions : | None |
| Remarks : | n/a |
| Turn-in directory: | ex10 |
| Files to turn in: | loading.py |
| Forbidden functions: | None |
| Remarks: | n/a |

This is a bonus exercise! You are about to discover the `yield` operator!
So let's create a function called `ft_progress(lst)`.
Expand Down
Binary file modified day01.pdf
Binary file not shown.
12 changes: 6 additions & 6 deletions day01/ex00/ex00.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

| | |
| -----------------------:| ------------------ |
| Turn-in directory : | ex00 |
| Files to turn in : | book.py, recipe.py, test.py |
| Forbidden functions : | None |
| Remarks : | n/a |
| Turn-in directory: | ex00 |
| Files to turn in: | book.py, recipe.py, test.py |
| Forbidden functions: | None |
| Remarks: | n/a |

You will provide a test.py file to test your classes and prove that they are working the right way.
You can import all the classes into your test.py file by adding these lines at the top of the test.py file:
You will provide a `test.py` file to test your classes and prove that they are working the right way.
You can import all the classes into your test.py file by adding these lines at the top of the `test.py` file:

```py
from book import Book
Expand Down
11 changes: 5 additions & 6 deletions day01/ex01/ex01.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

| | |
| -----------------------:| ------------------ |
| Turn-in directory : | ex01 |
| Files to turn in : | game.py |
| Forbidden functions : | None |
| Remarks : | n/a |
| Turn-in directory: | ex01 |
| Files to turn in: | game.py |
| Forbidden functions: | None |
| Remarks: | n/a |

You will have to make a class and its children.

Expand All @@ -19,8 +19,7 @@ Pick up a GoT House (e.g., Stark, Lannister...). Create a child class that inher
* `family_name` (by default should be the same as the Class)
* `house_words` (e.g., the House words for the Stark House is: "Winter is Coming")


Example:
**Example:**

```py
class Stark(GotCharacter):
Expand Down
Loading

0 comments on commit 72a2af1

Please sign in to comment.