QuantEcon / QuantEcon.cheatsheet

A cheatsheet for Python and Julia
154 stars 65 forks source link

programming section, show python whitespace #17

Closed sglyon closed 8 years ago

sglyon commented 8 years ago

In the programming section we go over basic control flow. The examples are valid/complete in Julia and matlab, but would have an error in python because there is no indented block after the start of the block.

Maybe we split them over 3 lines and do something like this:

if i <= N:
    # do something
if i <= N
    # do something
end
if i <= N
    # do something
end

I don't love that proposal, but I think highlighting the importance of whitespace would be helpful for a matlab programmer trying to use this to start learning python

vgregory757 commented 8 years ago

The indents are there in the .rst file. They're just not showing up in the html version. It seems like it has something to do with the theme, because they show up in the old version. cc @DrDrij