Advice on learning Python efficiently
61–70 of 75 posts
Re: Advice on learning Python efficiently
#62Pretty good advice, along with some good pointers about what NOT to do when learning a languages (ex. reading some instructional book cover-to-cover, forgetting most of the stuff along the way). I often suggest the read-a-chapter-write-a-program-based-on-it route, just to get the practice that is really important, and to solidify some intuition as to what the machine (whether interpreter or bare metal) is doing, and…
Learning Perl (the llama book) was great for that. At first, I would think that I understood just from reading the chapter, but doing the exercises at the end of each chapter made me actually learn it.
Re: Advice on learning Python efficiently
#63Earlier quoted context omitted.
What do you mean by the offside rule in this case? I presume you don't mean that Pyret can't shoot if it got the ball when it was behind all the other language's defenders.
Only if the Pyret was already in an offside position when the ball was last played by a team mate and it was not a goal kick, throw-in, or corner kick and Pyret was involved in active play (receiving the ball, interfering with a defender, or obstructing the goalkeeper's view)...but I digress. Python's use of semantic white space in the form of indentation is sometimes referred to as the 'offside rule'.
Re: Advice on learning Python efficiently
#64Earlier quoted context omitted.
>By doing python projects first you familiarize with it and then if you are still on - you should read zen of python, pep8, etc.. Would you mind recommending some projects for a python beginner?
A web search engine.
Re: Advice on learning Python efficiently
#65Earlier quoted context omitted.
Only if the Pyret was already in an offside position when the ball was last played by a team mate and it was not a goal kick, throw-in, or corner kick and Pyret was involved in active play (receiving the ball, interfering with a defender, or obstructing the goalkeeper's view)...but I digress. Python's use of semantic white space in the form of indentation is sometimes referred to as the 'offside rule'.
Interesting, I have never heard that term used in relation to Python white space. TIL
Re: Advice on learning Python efficiently
#66Pretty good advice, along with some good pointers about what NOT to do when learning a languages (ex. reading some instructional book cover-to-cover, forgetting most of the stuff along the way). I often suggest the read-a-chapter-write-a-program-based-on-it route, just to get the practice that is really important, and to solidify some intuition as to what the machine (whether interpreter or bare metal) is doing, and…
Also, MIT switched from scheme to python.
\tangent I agree with your approach of mixing theory and practice. So what's the best way to learn fluid simulation? It's discouraging spending so long on maths without the gratification of Something Actually Working.
Re: Advice on learning Python efficiently
#67Pyret's syntax looks far more complicated to learn than Python's for a beginner.
I'm curious which parts look (more) complicated to you. For some perspective, when teaching Pyret to total beginners, we start with arithmetic and calls to library functions, then build up to function definitions and examples. At that point, there's just a handful of syntactic constructs to consider, and they are nearly identical to Python. Things like "data" and "cases" don't come till later, and do come with more o…
def square(n):
return n * n
Pyret: fun square(n :: Number) -> Number:
n * n
end
there's extra stuff. It also kind of loses the elegance of Python reading close to normal language - if you don't know programing but can do math you'd figure the first was define a function that gives a square but be confused what (n :: Number) -> Number: was about.Re: Advice on learning Python efficiently
#68Re: Advice on learning Python efficiently
#69Earlier quoted context omitted.
I'm curious which parts look (more) complicated to you. For some perspective, when teaching Pyret to total beginners, we start with arithmetic and calls to library functions, then build up to function definitions and examples. At that point, there's just a handful of syntactic constructs to consider, and they are nearly identical to Python. Things like "data" and "cases" don't come till later, and do come with more o…
I noted the in first example in the linked into - Python: def square(n): return n * n Pyret: fun square(n :: Number) -> Number: n * n end there's extra stuff. It also kind of loses the elegance of Python reading close to normal language - if you don't know programing but can do math you'd figure the first was define a function that gives a square but be confused what (n :: Number) -> Number: was about.
fun square(n):
n * n
end
is a closer direct comparison to the Python program, for contexts that don't use annotations.