Getting Started in Python
Why learn Python?
Python is the language that many new programmers start off with. Here’s why:
Python code is really readable and easy to learn
Programming languages are just a tool to implement programming concepts. Since Python is very similar to the English language, it allows you to focus on these concepts of computer science rather than the syntax of the language. Other recommended beginner languages such as C++ or Java have more complex syntax which might interfere with the learning of the computer science concepts that can be transferred across languages.
For example, to print the statement “Hello World” in Java is coded:
However, the same statement in Python is coded:
Notice the difference in syntax? It’s much simpler, right? Python does not use the brackets that Java and other languages use, because Python enforces correct indentation of the code by making the indentation part of the syntax. Blocks of code are identified by the level of indentation, which results in code that is aesthetically pleasing and very readable!
Python is very marketable to big companies
Major companies and financial institutions use Python to do perform data automation and data mining, and people with a Python skillset are in demand. However, most programmers consider Python a good general purpose language. While much of the shipped software we interact with today does not contain Python, it is frequently used among programmers and provides a solid foundation of coding skill. A forum poster from StackExchange writes:
It usually won't make it into the job description, but it's almost an underground among programmers who use languages like C++ to use python when they have a choice, for one-off utilities, in-house applications, or things like automated test scripts that aren't shipped with their official product.
Python is extremely versatile
Python is a flexible language that has a wide variety of use. For example, Python used to develop web applications, use machine learning algorithms, gain useful info from big data and much much more. Python is not specialized for one purpose like how R is used for statistics, or how PHP is used for web programming. Since Python has been around for a long time, many libraries have been developed and the online community is very large.
Personally, I am very glad that Python was the first programming language I learned because it was so easy that I could focus on the programming concepts instead of the syntax. It was these concepts and way of thinking that ultimately allowed me to discover my love of computer science. This is not to say Python is the “best” programming language. Languages all have different benefits and disadvantages, and are all fairly easy to learn after learning your initial language!
What is Python used for?
Python is a general purpose programming language, which means it is used for a wide variety of functions including managing databases, analyzing malware, backend web development, data analysis, artificial intelligence and scientific computing. Using Python, you can build different kinds of applications, which are listed below and compiled from Python’s website.
- Web Development—You can develop the backend of a website! The back-end of a website is where the administrator can manage the features of the complete website such as changing text, images, adding products, prices and other functions.
- Scientific and Numeric Computing—Python is used very frequently in research. Often times, data that is obtained from research is not properly formatted and contain various issues such as missing values. Pandas is a data analysis and modeling library in Python that can be used to clean up the data.
- Education—Python’s website endorses it as a “superb language for teaching programming”. This is true, as mentioned above!
- Desktop Applications—Python also can be used to develop desktop applications using a package like Tkinter.
The possibilities are endless!
How should I get started learning Python?
If you're interested in a book, the best reviewed in my experience from talking with Python programmers is called Learn Python the Hard Way. This book is designed for adults with no experience in Python. For younger kids who are transitioning out of Scratch, we recommend this Coding Projects in Python book or this Help your Kids with Computer Coding book.
If you're looking for a digital solution, good place to start is Codecademy. Codecademy's "Python" tutorial is free, simple, and self-paced, and you don't have to install anything. They do have some projects that cost money, but these are not necessary to learn all the fundamentals of Python. At the end, you will learn how to make a development environment on your own computer!
For the Codecademy Python lessons, you follow the instructions on the left, typing the code into the terminal, and if you get stuck, there are hints available.
Udacity also has a very comprehensive, free, online guide to learning Python. There are super cool mini-projects, such as coding a program to hide a secret message in a collection of files or sending text messages to mobile phone, which reinforce the skills learned in the lesson. The whole course is only 13 hours total. In lesson 2 part 7, there are instructions for installing Python onto your computer.
Udacity is a bit different from Codecademy. Instead of having a local terminal, you need to have a text editor like Sublime Text that allows you to follow along with the videos.
The official Python website is also a great resource. Here is a tutorial from the website that introduces you to the basic concepts and features of the Python language and system. Note that this tutorial is not interactive and is mainly reading. However, this serves as a good, comprehensive reference guide while completing projects outside of a tutorial.
If you are serious about learning Python, a resource that is highly recommended by programmers is called Learn Python the Hard Way. I haven't personally been through all the exercises in the book, but I have seen it mentioned it various forums and posts.
What are some simple projects for a beginner?
I would recommend completing an online course such as the ones listed above to get started. Those include more than enough projects to become semi-proficient in Python. However, to become more independent, this link includes 5 mini programming projects for beginners in Python which covers a decent percentage of Python syntax.
My personal favorite is Hangman, a game where the user inputs a letter guesses for a word and the program will keep track of the letters in the word, and return a hangman like below. This project is a little bit tricky, as it requires a good understanding of Python syntax and how different concepts work together. But, it will be very rewarding in the end!
If anything at all in this guide interests you, I recommend you check out any of the links to start learning Python! Good luck!
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.