Learning to program

Great Success: Learning to program python and (finally) creating my first beginner python program

They say if at first you don’t succeed try, try again. Never in my life has this phrase been more appropriate that whilst learning to program python. After many, many tries, I have finally completed my first python program & successfully submitted it. It is a beginner python program based quiz. This post details how I got there. It has taken a while to build up my knowledge of programming in python so that I understand it. I have started to use supplementary material in the form of machine learning podcasts, a book called automate the boring stuff as well as seeking out advice using github and stackoverflow to get support. I’ll talk about these more later in the post but first I’m going to be super smug about finishing my beginner python program!!

Success for our beginner python program!!!

I’m a genius. I’m a genius. lalalala I am so smart. lalala so very very smart! Seriously it’s worth learning to program python and going through the pain of trying to understand it purely so you can feel the true joy Cameron and I felt when we managed to get our beginner python program to work. We were so happy. Below is a picture showing just how happy we were. It wasn’t easy but that just made it even better when we succeeded.  You can see the code we wrote using github here. Also check out how cool we are in our geek glasses 😀

beginner python program

So how are we learning to program python?

As regular readers will know Cameron and I are both doing the Udacity Intro to programming nanodegree. As you may have guessed from the post title we are currently on the section about learning to program python. At the end of this section you have to complete a project called Code Your Own Quiz. This is what I am referring to what I say I created my beginner python program. The code features several basic concepts in python. I have listed them below with links to the relevant documentation and examples for those who are interested.

Some concepts, in no particular order, covered in the beginner python program are:

Still staying motivated while learning to program in python

Many of you will also know that recently I have been finding it hard to stay motivated as I power through the course content. I talk about this and give some tips on how I stayed motivated in my last post. In addition to my beloved TED Talks, in the end I decided to seek help from some of my colleagues to build up my understanding. The next few sections cover off what they told me and also one tip straight from me.

I should probably say at this point that Udacity does provide additional material and office hours within the course  content.  However these tend to take the form of 40min to 1 hour YouTube video tutorials. I’m not saying these are bad but realistically when am I ever going to be bothered enough to sit down an watch them. I really want to learn to program python but I also really want to go to the pub with my friends cause for once it’s sunny. In all honesty I know if I was a better student I would find time but in reality I’m just going to add them to a long list of things I should do, never again to see the light of day (or screen).

learning to program python

With that in mind here’s what I actually did.

Step 1: Automate the Boring Stuff

Automate the Boring Stuff is a book that you can view online or download to your Kindle (other eReaders are available but I work for Amazon so I’m biased). The book is written by Al Sweigart, otherwise known as mine and Cam’s learning to program python guru. It was recommended to me by my colleague who is a Data Scientist. The idea behind Automate the Boring Stuff is that it teaches you how to automate, using python, the boring admin tasks such as pulling email addresses and phone numbers from text or webpages or renaming files.

automate the boring stuffUsing Automate the Boring Stuff

I set myself the goal of completing half of Automate the Boring Stuff before going back to complete my beginner python program with Udacity. Let me tell you, I wasn’t disappointed with the results. I’m not sure if it was the combination of the course and the book, a change in my mindset or the book alone but I definitely felt the benefit. What I liked about Automate the Boring Stuff was that because each chapter covers a different topic in python programming, I felt like I was gaining a much deeper understanding. I would definitely recommend this book to other python learners.

At the end of each chapter there is a set of quiz questions and a couple of projects for you to try to check your understanding. The really great thing is that from chapter 7 onwards, the programs you write are actually useful in the real world - they automate the boring stuff!

Step 2: Using github

Ok I’ll admit it I haven’t properly got into using github and sharing my projects on there but I can see that there are benefits to doing so.  Let me take a step back though, what is github?According to wikipedia, github is a web-based hosting service for version control using git. I’ll let  you read more about it, and the rest of that technical jargon on the wiki. All I know is that I can post on it projects and get help.

Why I like the idea of using github

Several of my friends have recommended using github to share my projects and get feedback on how to improve them to help me learn. This is one of my favorite things about programming and programmers. There seems to be a really great community of people out there who are willing to help you learn. It reminds me a lot of when I was working as a research chemist and how I would brainstorm solutions with others. This desire for knowledge and wanting to help others is something I am sad to say I find rather lacking in the corporate, target driven world.

One thing I will say about using github is that it’s really f***ing confusing when you start out so here’s a guide I found to help you out. And a tutorial for good measure. To be honest as I have only one beginner python program to share right now, I’m mainly just googling the problems I have and things I don’t understand then looking at answers on stackoverflow. It seems to be working.

Step 3, (a tip from me): Machine Learning Podcasts

machine learning podcasts

As discussed in my post on machine learning and my mission, I really love machine learning. I also love podcasts. So it made sense to me that I should look for some machine learning podcasts. At first I was worried that these might not exist. Thankfully I was wrong. I have actually managed to find multiple machine learning podcasts, and a helpful article evaluating each that I’ll share with you here.

Why podcasts I hear you say? Well I find that having something I can just listen to an absorb, about a topic I am interested in, really helps me keep motivated. In my case, and for my mission, it’s machine learning podcasts. Listening to them reminds me why I am going through the pain of learning to program in python and helps me push through.

Which machine learning podcasts are my favorite?

My favourite machine learning podcast currently is Data Skeptic. It’s really easy to understand, they don’t use too much jargon and the topics are interesting. They recently did a series on the Turing Test, something I want to explore more in my next post. You should definitely check it out if you’re interested in machine learning or data science.

Share your thoughts

I hope you find these tips useful. Comment to let me know how you’re getting along if your learning python or to share your own tips. If you have any podcast recommendations, especially machine learning podcasts, I’d also love to hear from you!

Don’t forget to also subscribe. I’m working on a newsletter just for subscribers with extra fun things I find about machine learning in the news as well as to get notified when new posts appear.Finally,  I’m setting up an Instagram account to go with this blog to share memes I find about programming and data science. Humor keeps me motivated and I love memes. Check it out using the Instagram icon link at the top of the page.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.