Path: ...!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Lawrence D'Oliveiro Newsgroups: comp.lang.python Subject: Spot The Syntax Error (Posting On Python-List Prohibited) Date: Thu, 21 Nov 2024 01:11:29 -0000 (UTC) Organization: A noiseless patient Spider Lines: 14 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 21 Nov 2024 02:11:29 +0100 (CET) Injection-Info: dont-email.me; posting-host="ef08745908c980c7c50adf3dc90da7e8"; logging-data="372424"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+3FoeK4xi4B7EBhy1bEr7P" User-Agent: Pan/0.160 (Toresk; ) Cancel-Lock: sha1:hvN3IKzslRGUxKgcArUh1WbyUmY= Bytes: 1545 We’ve all seen it happen: some small screwup in the whitespace when posting some Python code online turns the code into gibberish. Here’s another example: . Luckily, this is a small mistake, and it should be easy to guess what the correct code is. (Actually, there might be a second mistake, though this one affects the logic rather than the syntax.) This is yet another reason why I like to put “#end” comments in my code: they provide some extra redundancy, which makes it easier to recover from mistakes like this.