> For the complete documentation index, see [llms.txt](https://felienne.gitbook.io/codasium/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://felienne.gitbook.io/codasium/module-2.3-rekenmachine/les-2/les-2b.md).

# Les 2b

**Opdracht 1) Fork de startcode**&#x20;

Deze opdracht wordt afgetekend als:

* Je naar <https://replit.com/@mevrHermans/Pidk-K2-M3-L2a-start> bent gegaan
* Je dit programma 'geforkt' hebt met de fork knop

**Opdracht 2) Maak de code af!**

Deze opdracht wordt afgetekend als:

* Jouw code om een som vraagt.
* Jij netjes de onderdelen van de som print.

**Uitleg.** Er staat wal wat code voor jou klaar om mee te beginnen. Vul jij de goede codes op de streepjes in? Belangrijke codes om te gebruiken zijn deze:

* met `split()` kun je van een stukje tekst een lijst maken. Bij iedere spatie komt er een nieuw stukje in de lijst.
* met `[0]`haal je een element uit een lijst. Vergeet niet dat het eerste element element 0 heet!

**Opdracht 3) Maak de code af**

Deze opdracht wordt afgetekend als:

* Jouw code de som netjes uitrekent.

**Uitleg.** Nu moet de som natuurlijk nog uitgerekend worden. Kijk naar jouw code van vorige week en zorg dat de code goed rekent. Je mag jouw code natuurlijk kopiëren, maar let op! Er moet nog wel wat aan veranderd worden.

{% hint style="info" %}
Test je code goed? Krijg jij als antwoord op 5 + 5 55 in plaats van 10? dan heb je jouw getallen niet vertaald met `int()`!
{% endhint %}

**Op**

**Opdracht 5) Verbeter de foutmelding (Extra)**

Deze opdracht wordt afgetekend als:

* Je een nette foutmelding geeft als de gebruiker geen spaties gebruikt.

**Uitleg.** Ben je vergeten een spatie te gebruiken? Dan doet de code het niet goed. Probeer het maar eens, dan krijg je dit in beeld:

![](/files/-MZM7OJ5TP-oXvQQ1AkG)

Dat is natuurlijk niet zo netjes. Kun jij een mooie foutmelding maken? Je hebt daarvoor deze codes nodig:

* met `' ' in som` kan je kijken of er een spatie in de code zit
* een `if` om de som alleen uit te voeren als er een  spatie in zit


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://felienne.gitbook.io/codasium/module-2.3-rekenmachine/les-2/les-2b.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
