Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c842d03

Browse files
author
Amogh Singhal
authored
Update Python_Programming_Quiz.md
1 parent 8bd1d30 commit c842d03

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

‎Python_Programming_Quiz.md‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,4 +322,16 @@ finally:
322322
# OUTPUT:
323323
# This will print no matter what.
324324
```
325-
Because in the try block we got a __DivisionByZeroException__ and not ValueError, so that is not caught and `finally` block is executed.
325+
Because in the try block we got a __DivisionByZeroException__ and not ValueError, so that is not caught and `finally` block is executed.
326+
327+
#### 17. What is the `enumerate()` function in Python?
328+
`enumerate()` iterates through a sequence and __extracts the index position and its corresponding value__ too.
329+
330+
```
331+
>>> for i,v in enumerate(['Python','C++','Scala']):
332+
print(i,v)
333+
# OUTPUT:
334+
# 0 Python
335+
# 1 C++
336+
# 2 Scala
337+
```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /