You are viewing a single comment's thread from:

RE: Learn Python Series (#4) - Round-Up #1

in #utopian-io6 years ago

Wait. There's a for, else feature?

I've coded with python for many years and not even I knew this.

Big +1 to this tutorial (though it'd be nice if it were broken up and explained rather than a big code block with comments)

Sort:  

Cool huh! for else rocks! ;-)

I do agree with your explanations / wall of code / code formatting remark. But it's kind of hard to do it otherwise when there's a big (long) function body involved. The Condenser (Steemit.com) interface could do with a proper sintax-highlighted code formatter on the front-end, plenty of Open Source repos out there to implement that in no-time.

But I will try to implement your suggestion on the following episodes where longer code bodies are involved in one scope block. I could for example first add bits of code, then explain them, rinse & repeat, and at the end drop in all the code. However, I'm writing these on a Jupyter Notebook implementation (as iPynb files, when ready I'm exporting them to .md), and since they contain interactive "cells" that actually run / interpret the code it's kind of hard to detach groups of statements that belong to the same scope block into different cells (because of the indentation requirements of Python). Hence I'll get errors running them, and because I'm going to publish them as iPynb files on GitHub as well, I want each cell to work... Decisions, decisions! ;-)

Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.027
BTC 60796.19
ETH 2601.58
USDT 1.00
SBD 2.57