# Exercises

Each exercise carries the difficulty level indication:
- [*] Easy
- [**] Moderate
- [***] Advanced

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

```{admonition} Zip files
:class: important, dropdown

When you have a directory with contents, such as additional subdirectories and files, it is possible to *zip* it. The resulting **zipped (compressed) file** is *not* a directory anymore, but a *file*. Importantly, this zipped file takes up **less storage space**.  Additionally, you can treat it as a file, i.e., you can download it in one go, which makes it convenient for sharing.

For some exercises in this book, we want to share more than one file or an entire directory with you. To make downloading easier, we zipped those. In practice, this means you will occasionally be downloading `.zip` files.

However, to start treating them as directories, you will always need to **unzip** (extract) them. You can typically do this by double-clicking and, depending on your computer's OS, using additional options for extraction. Of course, it's also possible to unzip files from within the terminal with `unzip file.zip`, as long as you have *unzip* installed.

**Note**: if you see a `.DS_Store` or similar hidden macOS files in a downloaded zip, you can delete or ignore them.
```

```{admonition} Data management
:class: important, dropdown

It's good practice to think about managing your directories and folder, i.e., locations and names you give them. While it sounds like a small thing, it saves time in the long run (think in a few months' or years' time when you won't remember where your data is, unless you saved it in a logical place with a logical name). Therefore, when solving exercises from this book, try to keep your data and exercise solutions organized.
```

````{exercise} [*] Your computer
:class: dropdown

```{include} ../coding-exercises/chapter-03-terminal/exercise-your-computer.md
```

````

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

```{figure} ../coding-exercises/chapter-03-terminal/eco.jpg
---
height: 200px
name: eco
---
Coral reef ([photo source](https://www.flickr.com/photos/usoceangov/29778926783), NOAA's National Ocean Service, public domain).
```

{download}`Download this zip file<../coding-exercises/chapter-03-terminal/Ecosystems.zip>` and unzip it in your working directory. Open the terminal and use it to navigate to this new unzipped directory. 

```{include} ../coding-exercises/chapter-03-terminal/Ecosystems/exercise-ecosystems.md
```

````

````{exercise} [*] The Hogwarts library
:class: dropdown

{download}`Download this zip file<../coding-exercises/chapter-03-terminal/Library.zip>` and unzip it in your working directory. Open the terminal and use it to navigate to this new unzipped directory.

```{include} ../coding-exercises/chapter-03-terminal/Library/exercise-library.md
```

````

````{exercise} [*] Time traveler's data backup
:class: dropdown

{download}`Download this zip file<../coding-exercises/chapter-03-terminal/Time_travelers_backup.zip>` and unzip it. Open the terminal and use it to navigate to this new unzipped directory.

```{include} ../coding-exercises/chapter-03-terminal/Time_travelers_backup/exercise-time-travelers-backup.md
```

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

```{figure} ../coding-exercises/chapter-03-terminal/courses-tree-image.svg
---
height: 200px
name: courses-image 
---
Folder diagram 
```
{download}`Download this zip file<../coding-exercises/chapter-03-terminal/Courses.zip>` and unzip it. Open the terminal and use it to navigate to this new unzipped directory.

```{include} ../coding-exercises/chapter-03-terminal/Courses/exercise-courses.md
```
````

````{exercise} [*] Physics lab report
:class: dropdown

We got our hand on this {download}`physics lab report<../coding-exercises/chapter-03-terminal/Physics_lab_report.txt>`.

```{include} ../coding-exercises/chapter-03-terminal/exercise-physics-lab-report.md
```

````

````{exercise} [**] Organizing research data
:class: dropdown 

{download}`Download this zip file<../coding-exercises/chapter-03-terminal/Physics_data.zip>` containing some research data, and unzip it in your working directory. Using the terminal, explore the contents of the downloaded directory.

```{include} ../coding-exercises/chapter-03-terminal/Physics_data/exercise-physics-data.md
```

````

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

1. {download}`Download this zip file<../coding-exercises/chapter-03-terminal/Proteins.zip>` and unzip it in your working directory.

```{include} ../coding-exercises/chapter-03-terminal/Proteins/exercise-proteins.md
```

````

````{exercise} [**] Electron configurations
:class: dropdown 

{download}`Download this zip file<../coding-exercises/chapter-03-terminal/Elements.zip>` and unzip it in your working directory. Use the terminal to navigate to it and explore it.

```{include} ../coding-exercises/chapter-03-terminal/Elements/exercise-elements.md
```

````

````{exercise} [**] Alice in Wonderland and the Vim Replace
:class: dropdown

```{figure} ../coding-exercises/chapter-03-terminal/alice-teaparty.png
---
height: 250px
name: alice
---
"A Mad Tea-Party", illustration by John Tenniel for *Alice's Adventures in Wonderland* (1865, public domain; [image source](https://commons.wikimedia.org/wiki/File:Alice_par_John_Tenniel_25.png)).
```

```{include} ../coding-exercises/chapter-03-terminal/exercise-alice-wonderland-vim-replace.md
```

````

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

```{figure} ../coding-exercises/chapter-03-terminal/quote.svg
---
height: 150px
name: quote2
---
```

```{include} ../coding-exercises/chapter-03-terminal/exercise-quotes.md
```

````
