# Exercises

Each exercise carries the difficulty level indication:
- [*] Easy
- [**] Moderate
- [***] Advanced
- 🖌️ Uses the NaNoPy graphical environment

The highest difficulty level is meant for students who wish to challenge themselves and/or have previous experience in programming.

```{important}
Do **all** NaNoPy exercises (🖌️), whatever their difficulty level. They build on each other, so skipping one makes the next ones harder.
```

`````{exercise} [*] Calling functions
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-11-functions/01_Calling_functions.py>`

```{include} ../coding-exercises/chapter-11-functions/01_Calling_functions_rendered.md
```

`````

`````{exercise} [*] BMI
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-11-functions/02_BMI.py>`

```{include} ../coding-exercises/chapter-11-functions/02_BMI_rendered.md
```

`````

`````{exercise} [*] Local vs. global
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-11-functions/03_Local_global.py>`

```{include} ../coding-exercises/chapter-11-functions/03_Local_global_rendered.md
```

`````

`````{exercise} [*] Mutable parameters
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-11-functions/04_Mutable_parameters.py>`

```{include} ../coding-exercises/chapter-11-functions/04_Mutable_parameters_rendered.md
```

`````

`````{exercise} [*] Hardcoding - cell count thresholds
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-11-functions/05_Hardcoding_cell_count.py>`

```{include} ../coding-exercises/chapter-11-functions/05_Hardcoding_cell_count_rendered.md
```

`````

`````{exercise} [*] Hardcoding - projectile motion
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-11-functions/06_Hardcoding_projectile_motion.py>`

```{include} ../coding-exercises/chapter-11-functions/06_Hardcoding_projectile_motion_rendered.md
```

`````

`````{exercise} [*] Returning multiple values
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-11-functions/07_Return_multiple_values.py>`

```{include} ../coding-exercises/chapter-11-functions/07_Return_multiple_values_rendered.md
```

`````

`````{exercise} [*] Changing colours 🖌️
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-11-functions/08_Coloured_lines.py>`

```{include} ../coding-exercises/chapter-11-functions/08_Coloured_lines_rendered.md
```

`````

`````{exercise} [**] Motif finding
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-11-functions/09_Motif.py>`

```{include} ../coding-exercises/chapter-11-functions/09_Motif_rendered.md
```

`````

`````{exercise} [**] Gravity
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-11-functions/10_Gravity.py>`

```{include} ../coding-exercises/chapter-11-functions/10_Gravity_rendered.md
```

`````

`````{exercise} [**] Reverse complement
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-11-functions/11_Reverse_complement.py>`

```{include} ../coding-exercises/chapter-11-functions/11_Reverse_complement_rendered.md
```

`````

`````{exercise} [**] Documenting functions
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-11-functions/12_Documenting.py>`

```{include} ../coding-exercises/chapter-11-functions/12_Documenting_rendered.md
```

`````

`````{exercise} [**] Halloween route
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-11-functions/13_Halloween.py>`

```{include} ../coding-exercises/chapter-11-functions/13_Halloween_rendered.md
```

`````

`````{exercise} [**] Black Friday
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-11-functions/14_Black_Friday.py>`

```{include} ../coding-exercises/chapter-11-functions/14_Black_Friday_rendered.md
```

`````

`````{exercise} [**] Roman centurion
:class: dropdown

```{figure} ../coding-exercises/chapter-11-functions/15_Centurion/Overactive_centurion.png
---
height: 350px
name: cent1
---
```

```{figure} ../coding-exercises/chapter-11-functions/15_Centurion/Smart_centurion.png
---
height: 345px
name: cent2
---
```

```{figure} ../coding-exercises/chapter-11-functions/15_Centurion/Lazy_centurion.png
---
height: 355px
name: cent3
---
```

{download}`Download this exercise.<../coding-exercises/chapter-11-functions/15_Centurion.zip>`

```{include} ../coding-exercises/chapter-11-functions/15_Centurion/exercise-centurion.md
```

`````

`````{exercise} [**] Central dogma
:class: dropdown

```{figure} ../coding-exercises/chapter-11-functions/16_Central_dogma/Transcription.png
---
height: 100px
name: transcription
---
```

```{figure} ../coding-exercises/chapter-11-functions/16_Central_dogma/Translation.png
---
height: 100px
name: translation
---
```

{download}`Download this exercise.<../coding-exercises/chapter-11-functions/16_Central_dogma.zip>`

```{include} ../coding-exercises/chapter-11-functions/16_Central_dogma/exercise-central-dogma.md
```

`````

`````{exercise} [**] DNA sequence analysis
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-11-functions/17_DNA_analysis.py>`

```{include} ../coding-exercises/chapter-11-functions/17_DNA_analysis_rendered.md
```

`````

`````{exercise} [***] Caesar's cipher
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-11-functions/19_Caesar_cipher.py>`

```{include} ../coding-exercises/chapter-11-functions/19_Caesar_cipher_rendered.md
```

`````

`````{exercise} [***] Fibonacci sequence
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-11-functions/20_Fibonacci.py>`

```{include} ../coding-exercises/chapter-11-functions/20_Fibonacci_rendered.md
```

`````

`````{exercise} [***] Prime factorization
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-11-functions/21_Prime_factorization.py>`

```{include} ../coding-exercises/chapter-11-functions/21_Prime_factorization_rendered.md
```

`````

`````{exercise} [***] Matrix multiplication
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-11-functions/22_Matrix_multiplication.py>`

```{include} ../coding-exercises/chapter-11-functions/22_Matrix_multiplication_rendered.md
```

`````
