
Python is a beautiful and complex language that can be used for many applications, from data warehousing, statistical analysis, to social applications and even gaming.
But the truth is you don’t need to learn all of the language to start building web applications. And this is what this course is about.
You might be wondering, what do you need to know to Learn Python with this course?
The good news is — not much! You definitely don’t need a computer science degree or even be good at math. You will find that learning a computer language is more about solving puzzles and breaking down problems into small, repeatable pieces, like creating a recipe to produce the same dessert every time.
For me the best language to learn right now, specially if it’s your first language, is Python. Why do I say that? Here are some of the reasons.
In the next couple of videos we’ll learn how to properly install Python3 on Windows and Mac computers, as well as the option to use a cloud-based Python development environment that will let you learn the course without having a computer.
My favorite package manager for the Mac is Homebrew and that’s what we’ll use to install Python 3.
My favorite package manager for Windows is Chocolatey and that’s what we’ll use to install Python 3.
I’m constantly searching for the best Python cloud development environment and I keep coming back to PythonAnywhere. They are completely free but have really good plans, they have amazing customer service and they have MySQL and Postgres support builtin.
Before we begin, I wanted to talk about the two major Python versions: Python 2 and Python 3.
To have a first good taste of Python we don’t need to go farther than our terminal. Python allows you to interact with it using what’s called the “REPL”. That stands for “Read–Eval–Print Loop” and essentially it’s an interactive shell that lets you write short commands and get the output immediately.
Here we are at the Python Interactive Shell and we now want to be able to use Python as a calculator. How do we go about that?
When you are building your applications, often you will need to remember the result of an operation or just plain values.
In the previous lesson you saw that we named a variable “egg_carton”. So why didn’t we name it “eggCarton” or “egg-carton”?
Remember how we talked about how some values we were getting back from Python were different types?
In the previous lesson we were introduced to the String type in Python. Strings is one of the things you’ll use a lot in your application development, so it’s good to have a good understanding of the things you can do with them.
We’ve seen a bit of the list type in the previous lessons. It’s essentially a collection of ordered items.
Tuples are like lists, but with one key difference: they are inmutable, like strings and numbers. They are defined using parenthesis instead of brackets.
A really useful data type are dictionaries. Dictionaries are also sequences, but they have a key and a value. Let’s see what that looks like.
Looping refers to executing an operation or group of operations repeatedly until a condition is met.
There are many reasons why we would want to do a loop, and they’re usually related to lists and dictionaries, so now’s a good time to review them.
Sometimes we need to make decisions and add a “fork in the road” in our scripts, and that’s what we get with conditionals and control flow.
Just like mathematical operators, we can also group logical expressions with parentheses.
Even though technically not a Python type, date objects are an important part of any application.
So we’re going to write our first function. A function is a collection of statements that are executed every time you call the function.
Functions can accept incoming data through the use of their arguments. Arguments can be thought as variables that are being set from the outside and passed to the function. Let’s try that.
There is an important functionality that you should know about variables that we haven’t talked about and that’s the concept of scoping.
Object Oriented programming is a feature that is heavily used in professional programming but it’s the hardest to grasp by new developers.
The `dog` object is an instance of the `Animal` class.
What else can we do with our `Animal` class?
So what’s this `self` business? This refers to the instance itself, i.e. this variable will be associated just to each instance and not to the whole class. Without the `self`, if we change the value, it will be set to all instances, like we had it before.
Sometimes you want to leverage an existing Class and somehow work on features on top of that Class. Developers are lazy and that’s a good thing, we never, ever want to reinvent the wheel. If there’s a library out there that does it well and does it cheap, we use it.
So far the methods we’ve seen are called on an instance. What happens if we call `Dog.is_thirsty()` directly, without generating an instance of the object?
A Python module is a file containing Python definitions and statements. The file name is the module name with the suffix .py appended.
When you import the module from the terminal, you’re expected to interact with it using the statements necessary. But sometimes you want to run the module as a script and have it do somethings automatically or even pass parameters to it.
As your application grows you will want to further subdivide modules into their own directories and wrap everything up in one top level directory. We call this a package.
If you’re using PythonAnywhere, skip to the next section.
Since PythonAnywhere uses Linux, we’re going to use a couple of file and directory management commands. So make sure to have both the file editor and the bash console open on adjacent windows.
Let's finish the Animal Package.
When you start learning Python, one of the main causes of frustration is issues with modules not found. Whenever you get those issues, just come back and review this lesson. There is a logical explanation of why Python doesn’t find the module you’re trying to import.
There is another way to define the paths that your computer looks for scripts and that is through an Environment Variable called `PYTHONPATH`.
Sometimes things go bad with your script. You might have seen some of these errors pop up during the course, if you typed something incorrectly.
One of the most important and most misunderstood practices that every professional developer must have is a good understanding of unit testing.
Congratulations on finishing the course! You now have a really good foundation to start learning one of the Python web frameworks like Django or Flask.
Are you looking to change your life and become a software developer but don’t know where to start? Are you discouraged by long, multi-hour Python courses that don’t really seem to teach you what you really need to know or watched dozens of Youtube tutorials only to be more confused than before?
My name is Jorge Escobar and I have worked in some of the top tech companies in the world, from Yahoo! to MongoDB to PayPal, and now I’ve started my own educational project, FromZero, where I have helped thousands of students to kickstart their coding career.
Python is a beautiful and complex language. But the truth is you don’t need to learn all of it to start building applications. And this is what this course is about.
In about two hours I will teach you the essential parts of Python that you need to know to start using web frameworks, data science or artificial intelligence.
But don’t be fooled, we’re not cutting corners in this course. It is packed full of really complex stuff, but taught in a way that you will understand, even without having coded anything before.
Best of all, you don’t even need to have a computer. You will have the option to use a cloud-based Python development environment, so that you can practice at work or in a cyber cafe where you can pick up where you left off.
This course is so good, I even recommend it to people that have been already coding in Python for a while, as it will clear a lot of those quirky things that you always wondered about.
So, you have officially run out of excuses. You don’t need to know anything to take this course, no math, no computer knowledge.
We will start by learning about variables, strings, lists, loops and conditionals, then move on to functions, object oriented programming with classes and objects, modules and packages and round it all up with an introduction to unit testing.
The course has easy to follow and digestible video lessons as well as links to the code as we develop it. You can also purchase an eBook with all the material.
The course can take anywhere from 3 to 7 days to complete based on how much material the student completes daily.
Additionally we’re constantly updating the course, adding contents thanks to the feedback of our students.
Join this course and start your path to becoming a professional Python developer!