Reddit Gold: An in-depth guide on how to learn programming in Python, the best language for beginners

Reddit Gold highlights the most useful and educational content on Reddit as found on r/AutoBestOf.

Today’s post is from u/echo419 who gives an in-depth guide on how to learn programming in Python.

  • Edited to update links and for clarity

Heyo,

Professional developer here, to answer your questions:

  1. I think a fair assessment of your skill would be being able to get through [this list]( https://docs.google.com/document/d/1TyqD2_oDtiQIh_Y55J5RfeA91JJECc97xYIKM112H9I/edit) of projects from r/learnpython by the end of the month.
  2. I think a reasonable stretch goal would be to choose a few easy challenges (or an intermediate one if you feel up to it) off of r/dailyprogrammer
  3. Another interesting challenge would be to scrape some data/pull some data from a website via the API (reddit perhaps) and put it into a usable format and perform some calculations on it (e.g. What was the top post on October 2nd and October 3rd on reddit, or a particular subreddit and the difference in votes between them)

Yep, you’ll absolutely be able to build something by then.

By the end of the month you’ll have put in roughly 40 hours, by then I would expect that someone would be able to make reasonable/useful small applications to check the weather, determine stream uptime, poll APIs, do basic interactions and calculations, determine students in a class(and modify them) and determine the top grade, etc…

So, the challenging part will be using your time effectively.

Assuming you don’t have resources already, the wiki on r/learnpython is pretty good.

For video learning I’m a fan of the freeCodeCamp videos This Python One should work well enough.

In terms of books the one that I’ve seen most recommended to people starting out is Automate the Boring Stuff by Al Sweigert because it does a good job of balancing what you need to know without being to dry and gives you plenty of projects to work on and, it’s free online AtBS

To program quick/simple stuff (Hello world and the like) you can use repl.it It’s an online editor without having to worry about all the setup on your computer, they take care of everything for you.

A couple of challenges that new programmers run into (and traps I’ve fallen into myself are):
A. Getting overwhelmed
B. Tutorial hell

To solve A, what’s often recommended is breaking things down into small manageable chunks which is how most things are handled in programming, just like people don’t build a building without plans, designs, and slow/steady execution, so too is how most people approach programming.

For the first week or so, when you’re almost done with your 2 hours or so, choose a program you’ve created or one that you find interesting and read through each line of code and make sure you could explain to someone else what that line of code is doing.

To solve B, what I did was start solving problems that I found interesting, I got a rasberry pi and wrote a couple of twitter bots to constantly tweet weather, I wrote a sentiment analysis tool, I wrote a program that would summarize long form articles into a few sentences (Based off of this r/dailyprogrammer post)(https://www.reddit.com/r/dailyprogrammer/comments/683w4s/20170428_challenge_312_hard_text_summarizer/)

A suggested outline for how you might want to approach this month:
1. Take the first few days to a week or so, and learn the stuff you’ll need for programming (variables, operators, flow control, lists/dicts, functions, classes, etc..). If/when you get bored with this part of it, find something from the r/learnpython list to start programming and go through it that way.

The above step is a LOT to take in, don’t worry about getting it down 100%, there are programmers who have programmed for DECADES who still consistently look up a number of the things I listed above. Just make sure you know it well enough to explain what it does (i.e. what does a function do, how is a list different from a dict, what is a for loop vs. a while loop, etc…)

  1. From this point on, start to apply what you’ve learned and keep programming every day. You’ll get confused with stuff and hit various walls, EVERYONE does, because programming is abstract and a different way of thinking/approaching things this is where Google and Stack Overflow will be your friend.

When you get stuck on something, Google: “How do I…” or “What is…” and more than likely you’ll come up with a StackOverflow post with someone who has come across the same problem, read the answers, see what makes sense, and try different stuff. Oh, and Googling various Python interpreter errors is amazing too.

  1. For the last week/few days or so, choose a problem/find a problem that you find interesting that is manageable and start working on it. Like most other problems/challenges, you’ll want to break it down into manageable chunks that you can do within your time budget, and start working towards solving the overall problem

Oh, and one last challenge for you, because if you can do this:

“`
Write a short program that prints each number from 1 to 100 on a new line.

For each multiple of 3, print “Fizz” instead of the number.

For each multiple of 5, print “Buzz” instead of the number.

For numbers which are multiples of both 3 and 5, print “FizzBuzz” instead of the number.

“`

Congrats, you’re well on your way to being a developer (seriously, depending on who you ask 5-10% of developers who interview don’t attempt/won’t do the above problem)

Source

Leave a comment

Your email address will not be published. Required fields are marked *