From 898d9d43a3f70a55882542dcc9e907f345ab374f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Kir=C3=A1ly?= Date: Fri, 4 Oct 2019 10:25:57 +0200 Subject: don't overwrite list problem: assigning a list of animals to the list variable overwrites the list function, so that later in line 531 the list function is not available and raises a Type Error: ``` In [133]: list(filled_dict.keys()) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) in ----> 1 list(filled_dict.keys()) TypeError: 'list' object is not callable ``` solution: use another variable name instead of list --- python3.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'python3.html.markdown') diff --git a/python3.html.markdown b/python3.html.markdown index 430927a9..8ef53ad1 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -466,8 +466,8 @@ prints: 1 cat 2 mouse """ -list = ["dog", "cat", "mouse"] -for i, value in enumerate(list): +animals = ["dog", "cat", "mouse"] +for i, value in enumerate(animals): print(i, value) """ -- cgit v1.2.3