Kirkland Tech Consulting

How to: Learn Python

When people looking to learn how to code ask, where should I start, I generally tell them, with Python. In my opinion, Python is the easiest language to digest if you have no programming experience. Why? Python has high readability. It’s a logical language, meaning it’s easy to pick up writing code because it is not that different from reading plain text. Once you understand how to write code, you can pick up the concepts behind programming languages. Python’s intuitive language means that it lacks the syntax requirements of languages such as C# and Java. Also, the documentation is easy to understand. In other words, YOU (yes you) can start writing programs today. Python allows you to write very simple programs with little or no experience.

Using Codecademy

Before taking Intro to Data Science, I had never used Python before. We learned the basics of Python using codeacademy, which is completely FREE. All you need is an email address to sign up.

Python 2 Course

If you want to take the Python 3 course, you’ll need to sign up for the Pro version of the site. This is not necessary, in my opinion. Starting with the Python 2 course is a great first step.

Become a Data Scientist

Once you’ve already started learning Python, I recommend you jump right into a more advanced course. Based on my own research, I discovered the Become a Data Scientist course on codeacademy. This does require the Pro version. If are apprehensive about the cost or cannot afford it, you can start with a trial to see if it is worth your investment.

Practicing Your Python Skills

In my data science course, I wrote scripts to solve real-life problems. This is the key to mastering programming: understanding how to address everyday programs with code. You want to encounter a problem and figure out how to solve that problem using your language of choice.

The first step to this is pseudocode. When developers write pseudocode, they are using plain English to define each step of their algorithm or script. Writing out the steps of your solution is always the first step to writing code.

Our brains remember things better when they are conceptualized in real-life solutions. This is why I recommend the following sites to practice your Python skills.

Rosalind

One important application of data science is in DNA and genetic coding. Rosalind’s problems are based on concepts of bioinformatics. A great advantage to Rosalind is that you’re able to check your solution immediately. How you implement your solution is your choice. For each problem, a Google search is certain to reveal a number of implementations.

To solve Rosalind problems I recommend:

  1. Make sure you understand the problem. Google any terms you don’t understand. Find YouTube videos that explain things you don’t understand. There are countless resources at your disposal.
  2. Once you understand the concept behind your problem, write pseudocode. Write out each step you required to transform your input to the expected output. Find examples of pseudocode online to become more familiar with the various approaches.
  3. Now, write code. Use concepts and tools such as loops, lists, dictionaries, functions, and libraries to solve your problem. Stack Overflow is an excellent resource for finding examples of implementation and usage. Be careful not to spoil your solution!

Project Euler

If you’re someone who likes math, sequences, or puzzles, Project Euler is for you. The site offers a long list of computational problems that can be solved by computer programs. For instance, a problem might challenge you to find the first 100 numbers of the Fibonnaci sequence. It’s named after Euler, a multidisciplinary scientist who made many important mathematical discoveries.

Taking Your Skills to the Next Level

Once you are confident in your Python skills, I challenge you to write an API. If you are unfamiliar with the concept, here are some resources:

Building a Basic RESTful API in Python

Python API Tutorial

Absolute Beginner’s Guide to Slaying APIs Using Python