Are you struggling to find python programming examples and creating a beginner python program? That was me a few weeks ago. Fear not – you are not along and I’m here to help.
They say if at first, you don’t succeed try, try again.
Never in my life has this phrase been more appropriate than while learning to program Python.
After many, many attempts, 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.
Finding examples of other people’s python programs
I have started to use some 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 later in the post, but first I’m going to be super smug about finishing my beginner python program!!
What’s that image? To mark my success in learning to program Python, I have chosen an icon representing the internet. I think you’ll agree the internet has been pretty successful.
Advertising Disclosure: Artificially Intelligent Claire may be compensated in exchange for featured placement of certain sponsored products and services, or your clicking on links posted on this website.
Success is completing a beginner Python program!!!
Seriously it’s worth learning to program Python and going through the pain of trying to understand it purely so you can feel a pure joy Cameron and I felt when we managed to get our beginner Python program to work.
We were so happy when the ‘passed’ notification came through.
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.
Quiz coding is a great way to get started with functions when coding in python.
You can find an example of how to code a quiz using python here:
To ensure you are keeping motivated while learning Python, I recommend mixing up difficult and simple concepts in Python.
This is to allow you always to be seeing some progress.
As an example, start with the ‘print’ function, then ‘if statements.’ Then I would go back to a more straightforward concept like the ‘len’ function before tackling loops.
Some concepts, in no particular order, to cover for a beginner Python program are:
- Creating and calling functions: definition
- Print: definition
- Strings: definition
- While loops: definition
- If statements: definition
- Lists: definition
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 on motivation, I decided to seek help from some of my colleagues to build up my understanding.
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 were a better student I would find the 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).
With that in mind here’s what I actually did.
Below are some of the best sources of python programming examples I found that helped me learn python.
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 to teach you how to automate, using Python, tedious admin tasks such as pulling email addresses and phone numbers from text or web pages or renaming files. The book contains plenty of python programming examples.
Using Automate the Boring Stuff
I set myself the goal of completing half of Automate the Boring Stuff before going back to finish 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 or merely a change in my mindset, 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 for Python Programming Examples
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.
According to Claire GitHub is an all-knowing god that saves your arse when you get stuck with code.
All I know is that I can post projects on it and get help fixing bugs.
Here are three of the best I have found showing python programming examples:
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 is 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.
The desire for knowledge and wanting to help others is something I am sad to say I find somewhat lacking in the corporate, target driven world.
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. I then look at answers on StackOverflow. It seems to be working.
Step 3, (a tip from me): Machine Learning Podcasts
This is a specialist section for those using python as a route into data science.
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 favorite machine learning podcast currently is Data Skeptic.
It’s straightforward 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.
So what are your favorite sources of Python Programming Examples?
My top picks that helped with creating a beginner Python program are the python programming examples I found on:
- Automate the Boring stuff
Do you agree with my pics? Join the mailing list to carry on the discussion and hear more great examples.