From a21f5109557593e9f23ddda6b826985886c77b67 Mon Sep 17 00:00:00 2001 From: Dimitri Merejkowsky Date: Sat, 20 Apr 2019 18:10:11 +0200 Subject: [PATCH] more proofread --- sessions/python-10.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sessions/python-10.md b/sessions/python-10.md index db638f7..e1f2fb1 100644 --- a/sessions/python-10.md +++ b/sessions/python-10.md @@ -64,7 +64,7 @@ ZeroDivisionError: division by zero # Exemples d'erreurs * `b += 2` - **NameError** - * `a / 9` - **ZeroDivisionError** + * `a / 0` - **ZeroDivisionError** * `my_list[42]` - **IndexError** * ``my_dict["bad-key"]`` - **KeyError** * `1 + "two"` - **TypeError** @@ -169,7 +169,7 @@ if exists(): ```python try: file = open(filename) -catch IOError: +except IOError: ... finally: file.close() @@ -181,7 +181,7 @@ Pas besoin de `finally` :) ```python try: - with file = open(filename): + with open(filename) as file: lines = file.readlines() except FileNotFoundError: print("Fichier non trouvé")