WEBVTT

00:00.080 --> 00:02.600
Hello developers, and welcome back.

00:02.640 --> 00:05.120
Let's start diving into Python.

00:05.240 --> 00:13.520
And in this course we're going to learn the basics and the part of Python that it is required for machine

00:13.520 --> 00:14.240
learning.

00:14.440 --> 00:17.000
Python is a popular programming language.

00:17.200 --> 00:22.640
It was created by Van Rossum and released in 1991.

00:22.840 --> 00:30.520
It's used for web development, server side software development, mathematics system scripting, and

00:30.520 --> 00:32.120
machine learning.

00:32.320 --> 00:40.280
Python works on different platforms windows, Mac, Linux, Raspberry Pi, and etc. Python has a simple

00:40.280 --> 00:42.520
syntax similar to the English language.

00:42.720 --> 00:50.840
Python has syntax that allows developers to write programs with fewer lines than some other programming

00:50.840 --> 00:51.680
languages.

00:51.960 --> 01:00.990
Python runs on an interpreter system, meaning that code can be executed as soon as it is written.

01:01.030 --> 01:04.230
This means that prototyping can be very quick.

01:04.430 --> 01:11.790
Python can be treated in a procedural way, an object oriented way, or a functional way.

01:11.950 --> 01:19.710
We are going to use Python for the machine learning, so there is no need to install anything on your

01:19.710 --> 01:20.550
computer.

01:20.590 --> 01:26.910
As I told you, go to Colab, sign up or sign in with your account.

01:27.110 --> 01:35.870
Click Open Colab, import the file, upload the notebook and upload the notebooks that I provided in

01:35.910 --> 01:37.910
the resources folder below.

01:38.030 --> 01:43.350
Okay, later we're going to upload many files, so please pay attention.

01:43.350 --> 01:45.950
Download them from the resources folder.

01:45.950 --> 01:47.550
They are very simple.

01:47.670 --> 01:51.030
Click upload and you will get this file.

01:51.030 --> 01:57.390
This notebook will guide you through the fundamentals of Python programming starting from the very basic

01:57.540 --> 01:58.580
variables.

01:58.780 --> 02:00.020
Data types.

02:00.020 --> 02:00.860
Operators.

02:00.860 --> 02:02.780
Basic input output.

02:02.820 --> 02:03.340
Okay.

02:03.580 --> 02:07.220
So you can create text or cells.

02:07.340 --> 02:09.220
Let's start coding.

02:09.380 --> 02:13.620
The first thing we need to learn is creating variable.

02:13.620 --> 02:21.620
In Python, a variable is a name that refers to a value stored in the computer's memory.

02:21.780 --> 02:27.940
You can create a variable by assigning a value using the equals sign.

02:28.140 --> 02:36.980
For example, name Alice, age 25, height 5.9 and is a student is true.

02:37.020 --> 02:40.820
Variables are containers for storing data types.

02:40.860 --> 02:44.260
Python has no command for declaring a variable.

02:44.460 --> 02:49.460
A variable is created the moment you first assign a value to it.

02:49.580 --> 02:53.060
For example, here we created a variable called name.

02:53.060 --> 02:58.040
It's of type string a variable age of type int.

02:58.120 --> 03:04.920
A height variable of type decimal is a student is a variable of type boolean.

03:05.240 --> 03:07.960
So you can print those variables.

03:07.960 --> 03:11.840
Variables don't need to be declared with any particular type.

03:11.840 --> 03:16.880
You can even change type after they have been set by using casting.

03:16.880 --> 03:22.760
But we are uh, we are interested in this single thing.

03:22.920 --> 03:28.320
In order to print them, we can use the print function.

03:28.320 --> 03:36.480
So if I click on this run cell icon we get this output Alice 25 5.9.

03:36.480 --> 03:37.320
And true.

03:37.400 --> 03:40.720
Those lines are not executed.

03:40.760 --> 03:44.480
Those in green because they are start they are comments.

03:44.480 --> 03:50.320
And starting with this sign comments can be used to explain code.

03:50.320 --> 03:55.470
So here we are explaining that we are going to create an example for creating variables.

03:55.470 --> 03:57.990
And here let's print them.

03:58.110 --> 04:04.550
Comments can be used to make the code more readable, and comments can be used to prevent execution

04:04.550 --> 04:05.710
when testing code.

04:05.710 --> 04:11.350
So when running the code, those lines, those comments are not executed.

04:11.350 --> 04:13.550
So comments start with this sign.

04:13.550 --> 04:17.510
This hash tag and Python will ignore them.

04:17.550 --> 04:27.870
A variable can have a short name like x and y or more descriptive name like age, height, name is student

04:27.870 --> 04:28.830
and others.

04:28.830 --> 04:31.790
But there are some rules for Python variables.

04:31.830 --> 04:37.390
A variable name must start with a letter or the underscore character.

04:37.430 --> 04:43.470
A variable name can't start with a number, so I can't put like this five h.

04:43.670 --> 04:45.390
It will give me an error.

04:45.550 --> 04:51.990
A variable name can only contain alphanumeric characters and underscores.

04:52.190 --> 04:53.060
So here.

04:53.100 --> 04:53.740
Age.

04:53.860 --> 04:57.100
For example, I can make like this.

04:57.140 --> 04:57.980
It's good.

04:58.020 --> 04:58.540
Okay.

04:58.740 --> 05:04.620
But we can't replace numbers at the beginning of the name of the variable.

05:04.820 --> 05:07.100
Variable names are case sensitive.

05:07.100 --> 05:11.700
So age is different from this age variable.

05:11.940 --> 05:12.540
Okay.

05:12.780 --> 05:21.100
So this age is different from this age a variable name can't be any of the Python keywords.

05:21.220 --> 05:30.340
For example uh, the Python keywords uh def I can't create a variable named def for example 66.

05:30.420 --> 05:33.660
Uh I can't create a variable called for.

05:33.860 --> 05:35.380
This is for the for loop.

05:35.580 --> 05:37.860
Those are reserved keywords.

05:38.060 --> 05:46.700
I can't create f or I can't create else or any other variable or any other function.

05:46.700 --> 05:52.020
In Python those are reserved the reserved keywords in Python.
