College Success
How You Deal With College Anxiety
Learn how to deal with anxiety in college. Read about what anxiety is, why anxiety relief is essential, and tips on dealing with anxiety.
Jennifer Rivera
Subject Matter Expert
Computer Science
07.11.2023 • 7 min read
Udacity Data Scientist & Outlier Lecturer
Learn what Python is and why it’s popular. Also read the uses and applications of this programming language in the tech industry.
In This Article
Python is getting a lot of buzz these days. According to the 2022 StackOverflow Developer Survey of people who are learning to code, Python is the third most popular language overall and the most popular backend programming language. But why is it so popular?
With 12 years of experience in programming with Python, I can confidently tell you that its popularity is well-deserved. Let’s dive into the key reasons behind Python’s widespread adoption.
Source: StackOverflow
You have probably heard this before. But why exactly is Python so easy to learn compared with other programming languages?
The 3 main reasons are Python:
Is readable
Is an interpreted language (rather than a compiled language)
Fails fast (instead of failing slowly)
The guiding principles of Python’s design, as described in the Zen of Python, specifically state that “Readability counts.”
One key way readability is encouraged in Python is: “There should be one—and preferably only one—obvious way to do it.” Other languages like R and Ruby often offer several different syntax options for performing the same task.
This can be challenging for people learning to code because:
It adds to the number of choices that need to be made
It means that 2 very similar pieces of code might superficially look very different
The fewer extra options, the easier it is to read and understand documentation or someone else’s code.
Reading code is essential for learning to write code!
Another way is that Python uses intuitive English-language names for its constructs. For example, Python calls an ordered collection of objects a list, whereas many other programming languages use the term array. Both of these are English words were used before the invention of computer programming, but “list” has consistently been more mainstream.
Source: Google Books Ngram Viewer
Python is an interpreted language. This means the code is executed line by line rather than being compiled into an executable. This is great for beginners since it means you can test out each line of code as you write it. You have a better understanding of what is happening and how your code is translating into the context of your application.
It might seem strange to say that a language is easy to learn because it “fails”—whether or not that failure is fast. But a core aspect of learning to code is making mistakes and being able to identify and fix them! If your code is going to fail one way or another, it’s much better that the failure is fast and obvious rather than being slow and subtle.
Compared to compiled languages, Python fails a bit more slowly, but Python fails faster than other interpreted languages like Ruby and JavaScript. A great example of this is what happens when you use a Python dictionary.
A dictionary is a data structure that links keys to values. When you specify a key, the dictionary returns a value. For example, a dictionary key might be the name of a product, and the associated value might be the price.
In Python, if you try to retrieve the value for a key and that key is not one of the available keys in the dictionary, you get an error immediately.
If you do the same in JavaScript or Ruby, rather than producing an error the dictionary will return undefined or nil respectively. Those are both variable types intended to mean “nothing” or “empty”.
That might seem like a friendlier thing to do, but what happens if you try to apply a discount to the price?
In Ruby, you would get an error at that point. It’d be something like “undefined method `-' for nil:NilClass (NoMethodError)” because you are trying to subtract from a nil value, which is not a valid command.
But instead of the error coming from the line where you used an invalid key, the error comes from the line where you tried to apply the discount. Even though it’s delayed by one step, this could make the error more challenging to locate and resolve since those steps could be separated by multiple lines of code or even split between multiple code files.
In JavaScript, you still wouldn’t get an error—instead you would get NaN! This is yet another type of variable used to represent invalid values that mean “not a number”. Eventually you might try to use the NaN in a way that produces an error. But you also might never trigger an error and end up accidentally displaying the NaN as your final lookup result.
That kind of failure relies on users to report the incorrect value and is even harder to track down.
The Python language itself is an open-source project—you can see all of the source code on GitHub! This open-source license means that developers around the world are free to use Python to build their own open-source projects. Over 400,000 Python packages have been published to the Python Package Index and more are being released every day.
Python packages mean that Python programmers don’t need to “reinvent the wheel” when performing common tasks. Instead of building from scratch, Python programmers can accelerate their development process by installing and importing specialized packages for web development, data science, and more.
“Import antigravity” even exists. It’s a running joke in the Python community about how it’s so easy to import powerful functionality that you could probably import something that would let you float up in the air.
You might be scratching your head at this one. Isn’t the Python programming language notoriously slow compared to compiled languages like C and Java?
Well, in a head-to-head comparison performing identical tasks, Python is slower than those languages. However Python can still be fast because of the open-source packages mentioned above!
For example, the NumPy numerical computing library allows developers to write code in Python that is then sent to already-compiled C and Fortran code. This has accelerated the pace of scientific progress, from the first image of a black hole to the discovery of gravitational waves.
Another great example is PySpark, a Python interface to the Apache Spark data analytics engine. Spark is one of the most popular tools for Big Data and typically requires that commands be written in Java or Scala, but PySpark makes it accessible for Python developers as well.
In traditional academic contexts, the same individuals need to act as both researchers and teachers. This can introduce some tension, because the skills needed to perform research tasks and teaching tasks often differ.
Luckily Python tooling tends to be useful for both contexts. Academics can seamlessly transition between using Python to perform scientific experiments and using Python to teach classes. This overlap has meant that Python is increasingly the language of choice in academic institutions.
Popularity can be self-perpetuating! As more people use Python, the incentives keep growing to adopt Python technology stacks.
Many industry leaders use Python. A few famous examples are:
Dropbox
Spotify
Netflix
Uber
Some companies have even become Python Software Foundation sponsors so that they can actively influence the direction of the language and ensure its ongoing maintenance and success.
Some examples are:
Microsoft
Salesforce
AWS (Amazon Web Services)
Verizon
This sponsorship shows that these companies are invested in Python for the long term.
Python is a general-purpose language, but there are a few specific areas where it really shines: web development, DevOps, data science, and machine learning.
Python is commonly used to develop the backend for web applications. This is the software that runs constantly on a web server, waiting for incoming requests.
When it receives a request—for example, if someone has entered the relevant URL into a browser address bar—it retrieves the relevant data and serves website source code—HTML, CSS, and JavaScript—back to the browser.
This type of application would be challenging to implement from scratch. But with Python web development frameworks and Python language features—like decorators—they can be quick and easy to build in a few lines of code.
Web development frameworks listed on the official Python wiki include:
Django
Flask
Dash
FastAPI
DevOps—short for “development operations”—means preparing and automating the tooling needed for software development and deployment. Python is a useful tool for DevOps work because it has great support for scripting automation and infrastructure maintenance.
In a broader context than just DevOps, Python is one of the best languages for a cloud developer because it has great support on AWS.
Data science is my favorite thing to do with Python! Data science means combining scientific techniques with data analysis techniques to find insights.
Many great Python packages exist like:
pandas for performing data cleaning
SciPy for performing statistical analyses
NLTK for performing natural language processing
Matplotlib for creating data visualizations
(I actually used all 4 of these as part of my analysis in writing a published paper.)
Beyond the packages for specific data-related tasks, the scientific Python community has built some excellent tools for writing code in Python. The Jupyter Notebook is a great example—it integrates Python code and Markdown documentation in a web application that can be run in the browser from anywhere.
Organizations like Cookiecutter Data Science have also been working on developing standards for creating reproducible scientific analyses with Jupyter Notebooks.
Machine learning—also called “artificial intelligence—means applying data science techniques to “learn” from past data in order to make predictions, gain insights, and even generate innovative content. Python is a popular language for both traditional machine learning techniques like linear regression as well as cutting-edge deep learning techniques like neural networks.
Python libraries for traditional machine learning include:
Statsmodels, with modules for linear models, imputation, and time series analysis
Scikit-learn, with modules for nearest-neighbors models, tree-based models (e.g RandomForestClassifier), and gradient boosting models
And Python libraries for deep learning include:
TensorFlow
PyTorch
fastai
Hugging Face
OpenAI (creator of ChatGPT)
The Outlier Applied Computing program is a great way to get started with programming, stats, and more. Outlier is an affordable alternative to traditional college courses. Outlier courses are flexible, are taught 100% online, and confer 3-4 transferable credits each.
In the first term you’ll get started with Java programming in Computer Science I—where, by the way, I’ll be one of your instructors! Then with the career certificates you’ll learn how to apply Python to data analytics, backend web development, or IT support.
Outlier (winner of TIME Best Inventions 2020) and Golden Gate University (#1 school for working professionals) have redesigned the experience of earning a college degree to minimize cost and maximize outcomes. Explore a revolutionary way to earn your college degree:
College Success
Learn how to deal with anxiety in college. Read about what anxiety is, why anxiety relief is essential, and tips on dealing with anxiety.
Subject Matter Expert
College Success
Learn exactly what Outlier.org is and its ultimate mission for its degrees and courses. Also, find out who Outlier partners with and read some student reviews.
Subject Matter Expert
Economics
This article explains what price elasticity is, the determinants of price elasticity, and the difference between price elasticity of supply and demand.
Subject Matter Expert