> 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-1/les-1b.md).

# Les 1b

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

Deze opdracht wordt afgetekend als:

* Je naar <https://replit.com/@mevrHermans/Pidk-K2-M3-L1a-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 netjes op twee getallen vraagt
* Jouw code om een operator vraagt (dat zijn symbolen van wiskunde: plus, min, keer, gedeeld door)
* Jouw code dan het antwoord print

**Uitleg.** Er staat al wat code voor jou klaar om mee te beginnen. Belangrijke codes om te gebruiken zijn deze:

* met `getal = input(tekst)` vraag je de gebruiker om een getal, dat komt in de variabele `getal`.&#x20;
* `int(tekst)` vertaalt de tekst tussen haakjes in een getal
* `if: elif: else:` gebruik je om een keuze te maken
* `round()` rond het getal netjes af voor we printen

{% hint style="info" %}
Vergeet niet dat Python voor een sterretje gebruikt, dat is deze \*. Python gebruikt voor gedeeld door de slash, deze /
{% endhint %}

**Opdracht 3) Verbeter de foutmelding**

Deze opdracht wordt afgetekend als:

* Je een nette foutmelding krijgt als je iets invoert dat geen getal is.

Als je een verkeerde operator invoert, krijg je een mooie foutmelding te zien:

![](/files/-MYy__Du44bsoh_TrCZl)

Maar misschien had je ook geprobeerd om iets in te voeren dat geen getal was. Dan gaat niet goed, dan krijg je dit:&#x20;

![](/files/-MYy_8VaLtOMGvjo4iZc)

Zorg dat je ook een mooie foutmelding krijgt als `getal1` of `getal2` geen getal is. Daarvoor hebben we een nieuwe code nodig: `is_getal(getal_1)`Met die code kun je kijken of een tekst die ingevoerd is, wel een getal is. De functie `is_getal` staat al voor jou klaar bovenin het programma.

Zet jij de code zelf in een `if`?


---

# 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-1/les-1b.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.
