0:00
Hello, my name is Jean-Christophe Chouinal
0:02
Today we will learn the simplest way to start using Python today
0:08
So if you're just getting started and you know nothing about Python, Google Collab is your
0:13
best tool that you can use to start doing Python because you don't have to install Python
0:18
In order to use Google Collab, all you need is a Gmail account
0:26
What Google Collab is, it's a free Jupyter notebook. that you can run Python in the browser
0:32
without any kind of configuration. So you can either go to my article
0:37
and go to Google Collab this way or you search on Google in order to get it
0:46
So let's get started with Google collab and understand what you can do with it
0:53
So first what we can do is create a new notebook. The good point I'm with the Jupyner notebook is that you can comment your code using
1:06
markdown syntax. So for instance I can write this is my first Python tutorial
1:17
So now if I run this and I add a box of code I can see I have added a title to my code
1:26
And then I can run Python code by saying print. Hello, world
1:31
As simple as that, so you've, just by doing this, you've already started to do Python without installation or nothing
1:42
So this is very interesting, right? So let's see what else we can do with Python and Google collab
1:49
And again, everything I'm going to show you today is there is inside this article
1:56
So let's zoom in a little bit. So in terms of text, you have many things you can do
2:04
You can do this is an H2. This is an H3 and this is text
2:13
You can add a link like this. So you put in parentheses and H2
2:21
www. jaciswinnar and then you run it and you can see that all of this will become HTML once you run this So what else can we do
2:39
So if we go into code many times if you do Python you may enter the terminal and write
2:48
Python like this you could Python tree you could go here You could go here, you could write print, hello
3:01
and then you would run this and you'll be that. You'd be done
3:07
When you want in Python to install stuff, you could say PIPTree install or you could say PIPTree
3:16
list every single package I have installed. So now you would have this
3:23
but in order to run the PIP command you need to go in the terminal so in order to do this in
3:29
command line all you need to do is you go with the exclamation point and then you are instantly
3:37
interacting with the terminal so you can run this same command within
3:45
within COLAB which is a fantastic feature that is offered else what you can do
3:53
do you can also do piplist minus v and then what you want to do is you could use grep in order to
4:00
find any package that contains tensor flow for instance so now you will see okay yes i have all
4:09
these libraries that are pre-installed in uh in python so this is interesting uh you may want to know
4:17
what python version you are we are using so if you want to know we
4:23
which Python is installed in in Colab, you can see that is Python 3.8.60
4:29
If you want to install a library that you don't have, all you could do is do PIP, install
4:36
Advert Tools, and then you would be able to run... Wait, wait, let's do this, you could be running import, advert
4:53
tools and then you could see that it has been installed in your library Okay so enough with the needy let try to understand a little bit what else you can do and what on your left here
5:12
So here on your left you have the table of contents. So you see we use headings. We can easily move to our section by going through the table of content
5:25
There is find and replace, so you could say text. I want to replace with text two
5:32
And then you text two, for instance, you could replace all, and then it would be replaced everywhere
5:40
They are the variables. So variables, what are Python variables if you've never learned how Python work
5:49
This is just an introduction, but you can add data to, you could say very, very much
5:55
variable one equal one. So that, or you could set out variable two equal hello
6:03
Or you could say variable three equals a list. One, two, three
6:10
So essentially you can store stuff in the variables and then when you reference it
6:16
then you could know what the variable is storing. And what's interesting here is the variable panel
6:25
show you all the variables that you've stored. So essentially if you change your variable one
6:31
and you change this to two, then you could kind of know that it still exists
6:38
It didn't create a second time. So maybe that was a bad idea to reuse the variable
6:44
Anyway, you have this file explorer right here on the left. What's interesting, we'll see a bit later
6:54
but essentially it's all the files that you have available in order to interact with you have
7:00
code snippets that i don't want to dive too much into you have also uh search commands so you can just
7:09
say clear out all output for instance uh so so this is interesting and and finally you have a
7:19
you could have access to terminal but you would need to sign up for a free version
7:24
Okay, let's shut down this. Another thing that is interesting with Another thing that is interesting with Google Collab is you can have free GPU so if you doing machine learning and you need extra capacity you
7:42
have free extra capacity by going to runtime change runtime type and you can use
7:48
GPU or TPU and then you would have free free GPU included
7:54
probably one of the most important thing that you need to know in
7:59
is whenever I started collab, I would go mount drive. So Google collab is a Google tool
8:08
So if you have Google Drive, you can store files in Google Drive
8:12
What if you want to get them from Google Collab, then you could just say
8:17
you could just import from Google. That collab, import drive
8:28
Drive and then what this allows you is to drive mount oops what this allows you to
8:37
do is you write drive mount and you can say content drive and then by doing
8:49
this what will happen is that you can connect to Google Drive accept you connect
8:55
your account you say okay allow everything and then Google Collab now connects to your Google Drive
9:03
So when you go into your File Explorer, let's wait that it's finished
9:07
Now it says mounted at Google Drive. If you go to your file explorer, you can now see your own Google Drive
9:13
with your own files that you can start importing straight up from Google Collab
9:23
So this is it. do a lot of Python but we'll learn a lot more about Python in other tutorial I
9:33
just wanted to let you know you can easily follow all the tutorials within
9:39
this course using Google collab alternatively you can use VS code that I'm
9:44
using but it's completely okay to use Google collab for this tutorial if you
9:52
if that's what you prefer otherwise feel free to install Vs code
9:58
So thank you very much for listening to this tutorial and see you in the next one