Python for Beginners Learn Python in 1
Hour
Programming with Mosh
This Python tutorial covers everything you need
to know to start programming in Python. from
downloading the latest version of Python to learn+ng
about var+ables and data types. It aiso provides an
exercise for the reader to practice their skills.
Iphone or 1Pad you need to înstall a couple of other
things first so you go to the App Store and search
for Pycharm. Then in the App Store click on the
install button. Now. Once Pycharm is înstalled, you
can open t up by cl+ckîng on this +con. Here in your
downloads folder. You should also have a.py file. So
let's open that up now. The first thing you 're going
to do is create a new project so let's do that by
clicking on this green plus sign here în your project
explorer window and type in Python. This +s the
name of your project. Now let's choose a location
four your project so we're going to choose a folder
on our computer called projects and then click on
the create Button Now let's change some settings
Inside of Pycharm. So first thing you 're going
to. To want to do is change the language of your
project to Python. So inside of pycharm. Go to Fle
>Settings> Project Sertings and in the Languages
section change Python to the language of your
project. Now next thïng you 're going to want to do
is set up your project folder so înside of pycharm
go to File > Settings > Project Structure and in the
Project Folder section cl+ck on the Browse button
and then select the folder where you want your
project files to live so now Your project +s set up
, and ready to g0 all ríght let's start writing some
code. We're going to start wîth the sîmplest code
possible and that's a hello world program. In Python.
A Hello world program is sîmply a program that
prints out hello world so let's open up our.py file
and enter thïs code here. Here Import sys I UNK]
world!) all right so we've Tmported thee Sys module
and then we've printed out UNK] world!" now
Let's save our file by click+ng on thïs green button
here in your editor window and call t Hello.py now
let's run our program by clicking on this green run
button here inside of pycharm and you'll see that
our program has prînted out [ UNK] world!" all
right that's our first sîmple code block în Python
now Let's take a look at some more code blocks
in Python. First thïng we'll want to do is create
a varfable, so lets open up our hello.py file agaïn
and enter this code def [ UNK] [ UNK] world!) all
right so we've defined a function calied say
hello) and înside of say hello) we're going to
print out [ UNK] world" now let's save our flle
once again say we want to declare a varfable called
price. We would type price and then after we type
the name of the variable. We would put a colon
and then the value of that varïable. So în thïs case.
the value of this var+able will be 12.99. So we can
use this var+able anywhere lnside our Python code
now let's say we want to print the value of this
varïable. We can do that by sîmply writing print
price and then after that we would put a period and
then the value of the varïable. So în thïs case the
code would pr+nt out 12.99 alright. Now let 's say
we wanted to change the value of thïs var+able. We
can do that by simply tyøing new value for price
and then after that we would type a colon and then
the new value of the varïable. So in thïs case the
code would pr+nt out 13.00 airïght. Now let's say we
wanted to delete thïs varïable. We can do that by
simply typing delete price and then after that we
Hour
Programming with Mosh
This Python tutorial covers everything you need
to know to start programming in Python. from
downloading the latest version of Python to learn+ng
about var+ables and data types. It aiso provides an
exercise for the reader to practice their skills.
Iphone or 1Pad you need to înstall a couple of other
things first so you go to the App Store and search
for Pycharm. Then in the App Store click on the
install button. Now. Once Pycharm is înstalled, you
can open t up by cl+ckîng on this +con. Here in your
downloads folder. You should also have a.py file. So
let's open that up now. The first thing you 're going
to do is create a new project so let's do that by
clicking on this green plus sign here în your project
explorer window and type in Python. This +s the
name of your project. Now let's choose a location
four your project so we're going to choose a folder
on our computer called projects and then click on
the create Button Now let's change some settings
Inside of Pycharm. So first thing you 're going
to. To want to do is change the language of your
project to Python. So inside of pycharm. Go to Fle
>Settings> Project Sertings and in the Languages
section change Python to the language of your
project. Now next thïng you 're going to want to do
is set up your project folder so înside of pycharm
go to File > Settings > Project Structure and in the
Project Folder section cl+ck on the Browse button
and then select the folder where you want your
project files to live so now Your project +s set up
, and ready to g0 all ríght let's start writing some
code. We're going to start wîth the sîmplest code
possible and that's a hello world program. In Python.
A Hello world program is sîmply a program that
prints out hello world so let's open up our.py file
and enter thïs code here. Here Import sys I UNK]
world!) all right so we've Tmported thee Sys module
and then we've printed out UNK] world!" now
Let's save our file by click+ng on thïs green button
here in your editor window and call t Hello.py now
let's run our program by clicking on this green run
button here inside of pycharm and you'll see that
our program has prînted out [ UNK] world!" all
right that's our first sîmple code block în Python
now Let's take a look at some more code blocks
in Python. First thïng we'll want to do is create
a varfable, so lets open up our hello.py file agaïn
and enter this code def [ UNK] [ UNK] world!) all
right so we've defined a function calied say
hello) and înside of say hello) we're going to
print out [ UNK] world" now let's save our flle
once again say we want to declare a varfable called
price. We would type price and then after we type
the name of the variable. We would put a colon
and then the value of that varïable. So în thïs case.
the value of this var+able will be 12.99. So we can
use this var+able anywhere lnside our Python code
now let's say we want to print the value of this
varïable. We can do that by sîmply writing print
price and then after that we would put a period and
then the value of the varïable. So în thïs case the
code would pr+nt out 12.99 alright. Now let 's say
we wanted to change the value of thïs var+able. We
can do that by simply tyøing new value for price
and then after that we would type a colon and then
the new value of the varïable. So in thïs case the
code would pr+nt out 13.00 airïght. Now let's say we
wanted to delete thïs varïable. We can do that by
simply typing delete price and then after that we