Skip to content
Snippets Groups Projects
Commit 2dd80758 authored by Bertrand  NÉRON's avatar Bertrand NÉRON
Browse files

fix typo in average exercice

parent a61cb0b0
No related branches found
No related tags found
No related merge requests found
...@@ -56,7 +56,7 @@ Exercice ...@@ -56,7 +56,7 @@ Exercice
How to compute safely the average of a list? :: How to compute safely the average of a list? ::
float(sum(l))/float(len(l) float(sum(l)) / float(len(l))
exercise exercise
-------- --------
...@@ -318,6 +318,12 @@ solution :: ...@@ -318,6 +318,12 @@ solution ::
for key in d.keys(): for key in d.keys():
inverted_d[d[key]] = key inverted_d[d[key]] = key
solution ::
inverted_d = {}
for key, value in d.items():
inverted_d[value] = key
solution :: solution ::
inverted_d = {v : k for k, v in d.items()} inverted_d = {v : k for k, v in d.items()}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment