---
id: 474c23ec0df6e7af920e0526
title: While Loop
challengeType: 11
videoId: s6yz4Ew8dwQ
dashedName: while-loop
---

# --description--

In this video, you will learn how to work with while loops to repeat code blocks as long as a condition is `True`.

# --questions--

## --text--

What will be the output for the following code?

```python
i = 1

while i <= 10:
    print(i)
    i += 1
print("Done with loop")
```

## --answers--

```md
1
3
5
7
9
Done with loop
```

---

```md
1
2
3
4
5
6
7
8
9
10
Done with loop
```

---

```md
2
4
6
8
10
Done with loop
```

---

```md
1
2
3
4
5
6
7
8
9
Done with loop
```

## --video-solution--

2
