Commit 61b8b54c authored by Loic Huder's avatar Loic Huder
Browse files

Changed example of dict comprehension

parent 3f7d1271
Pipeline #32973 passed with stage
in 57 seconds
......@@ -310,11 +310,11 @@
ns.pop()
```
%%%% Output: execute_result
3
12
%% Cell type:markdown id: tags:
## Complity :
......@@ -452,13 +452,14 @@
```
%% Cell type:code id: tags:
``` python
# dict comprehension (here for the "inversion" of the dictionary)
# dict comprehension (here to change the case of values)
print(d)
d1 = {v: k for k, v in d.items()}
d1 = {k: v.upper() for k, v in d.items()}
print(d1)
```
%% Cell type:markdown id: tags:
## Do it yourself:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment