Learning Curves: My Fun Blog

On life. One learning curve at a time on the path to becoming a renaissance man.

Previous Entry Share Next Entry
Learning Python vs. learning Programming through Python
gevron
Of all the resources to learn Python I chose Codecademy, which step by step teaches you the language. Or does it?

While I am VERY happy with how Codecademy works using step by step victories... AND I actively recommend it, it teaches you to program, not to be a Python programmer. Example:

# Write your function below!
def fizz_count(x):
....count = 0
....for item in x:
........if item == "fizz":
............count = count +1
.
....return count
.
fizz_count(["fizz","cat","fizz"])
print count
My mentor suggested I use the python help and the IDLE autocomplete function to learn Python, and (mind blown #4) think about how I'd write the code in plain language, or pseudo-code.

On the code above, he asked me:
"What is the simplest way you can imagine to accomplish what you want to do?"
I answered: "count"

Here is the new code:
list.count("fizz")
Where list stands in for fizz_count from above.

?

Log in

No account? Create an account