# Les 5a

## Printen

Aan het einde van de les kun jij:

* nog beter met de while werken
* elementen uit een lijst halen met while

**While**

1\) Welke van deze programma's print **3 keer "Hallo"** uit?

Schrijf de goede code over in je schrift!

```python
1:
punten = 1
while punten == 3:
  print("Hallo")
  punten = punten + 1

2:
punten = 1
while punten < 3:
  print("Hallo")
  punten = punten + 1

3:
punten = 1
while punten < 4:
  print("Hallo")
  punten = punten + 1
```

2\) Welke van deze programma's print **1 tot en met 6** uit?

```python
1:
punten = 1
while punten == 7:
  print(punten)
  punten = punten + 1

2:
punten = 1
while punten < 7:
  print(punten)
  punten = punten + 1

3:
punten = 1
while punten < 7:
  punten = punten + 1
  print(punten)
```

3\) Welke van deze programma's print 5x een dobbelsteen worp uit? Lees de code goed!

```python
1:
teller = 1
while teller < 6:
  print(random.randint(1,6))
  teller = teller + 1

2:
teller = 0
while teller < 6:
  print(random.randint(1,6))
  teller = teller + 1

3:
teller = 1
while teller < 5:
  print(random.randint(1,6))
  teller = teller + 1
```

**Remove**

1\) Goed of fout?

Goed: Schrijf wat de code print\
Fout: Schrijf op wat de fout is.

```python
1:
weekdagen = ['ma', 'di', 'wo', 'do', 'vr', 'za']
weekdagen.remove(za)
print(weekdagen)

2:
dobbel = [1, 2, 3, 4, 5, 6]
dobbel.remove(7)
print(dobbel)

3:
dobbel = [1, 2, 3, 4, 5, 6]
dobbel.remove(4)
print(dobbel)

4:
weekdagen = ['ma', 'di', 'wo', 'do', 'vr', 'za']
weekdagen.remove('ma')
print(weekdagen)

5:
dobbel = [1, 2, 3, 4, 5, 6]
dobbel.remove()
print(dobbel)
```


---

# Agent Instructions: 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:

```
GET https://felienne.gitbook.io/codasium/module-1.3-geschiedenis/les-5/les-5a.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
