From ae31e8f0073b4e3139041a60d4a6a277e32f2957 Mon Sep 17 00:00:00 2001 From: murtazasaif Date: Wed, 31 Oct 2018 11:00:52 -0400 Subject: [PATCH] Updating index.md (#20547) Describing how to get just values from a dictionary in Python 3.x --- .../python/data-structures/dictionaries/index.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/guide/english/python/data-structures/dictionaries/index.md b/guide/english/python/data-structures/dictionaries/index.md index 2d80e31328..711ae14250 100644 --- a/guide/english/python/data-structures/dictionaries/index.md +++ b/guide/english/python/data-structures/dictionaries/index.md @@ -112,3 +112,13 @@ Use **`items()`** for Python 3.x: y 2 z 3 ``` + +To loop over just the values in the dictionary, do this in Python 3.x: +```python + >>> for value in d.values(): + ... print(value) + ... + 1 + 2 + 3 +```