Hello developers, and welcome back.
Let's start diving into Python.
And in this course we're going to learn the basics and the part of Python that it is required for machine
learning.
Python is a popular programming language.
It was created by Van Rossum and released in 1991.
It's used for web development, server side software development, mathematics system scripting, and
machine learning.
Python works on different platforms windows, Mac, Linux, Raspberry Pi, and etc. Python has a simple
syntax similar to the English language.
Python has syntax that allows developers to write programs with fewer lines than some other programming
languages.
Python runs on an interpreter system, meaning that code can be executed as soon as it is written.
This means that prototyping can be very quick.
Python can be treated in a procedural way, an object oriented way, or a functional way.
We are going to use Python for the machine learning, so there is no need to install anything on your
computer.
As I told you, go to Colab, sign up or sign in with your account.
Click Open Colab, import the file, upload the notebook and upload the notebooks that I provided in
the resources folder below.
Okay, later we're going to upload many files, so please pay attention.
Download them from the resources folder.
They are very simple.
Click upload and you will get this file.
This notebook will guide you through the fundamentals of Python programming starting from the very basic
variables.
Data types.
Operators.
Basic input output.
Okay.
So you can create text or cells.
Let's start coding.
The first thing we need to learn is creating variable.
In Python, a variable is a name that refers to a value stored in the computer's memory.
You can create a variable by assigning a value using the equals sign.
For example, name Alice, age 25, height 5.9 and is a student is true.
Variables are containers for storing data types.
Python has no command for declaring a variable.
A variable is created the moment you first assign a value to it.
For example, here we created a variable called name.
It's of type string a variable age of type int.
A height variable of type decimal is a student is a variable of type boolean.
So you can print those variables.
Variables don't need to be declared with any particular type.
You can even change type after they have been set by using casting.
But we are uh, we are interested in this single thing.
In order to print them, we can use the print function.
So if I click on this run cell icon we get this output Alice 25 5.9.
And true.
Those lines are not executed.
Those in green because they are start they are comments.
And starting with this sign comments can be used to explain code.
So here we are explaining that we are going to create an example for creating variables.
And here let's print them.
Comments can be used to make the code more readable, and comments can be used to prevent execution
when testing code.
So when running the code, those lines, those comments are not executed.
So comments start with this sign.
This hash tag and Python will ignore them.
A variable can have a short name like x and y or more descriptive name like age, height, name is student
and others.
But there are some rules for Python variables.
A variable name must start with a letter or the underscore character.
A variable name can't start with a number, so I can't put like this five h.
It will give me an error.
A variable name can only contain alphanumeric characters and underscores.
So here.
Age.
For example, I can make like this.
It's good.
Okay.
But we can't replace numbers at the beginning of the name of the variable.
Variable names are case sensitive.
So age is different from this age variable.
Okay.
So this age is different from this age a variable name can't be any of the Python keywords.
For example uh, the Python keywords uh def I can't create a variable named def for example 66.
Uh I can't create a variable called for.
This is for the for loop.
Those are reserved keywords.
I can't create f or I can't create else or any other variable or any other function.
In Python those are reserved the reserved keywords in Python.