In this tutorial I 'm going to show you how to download and install Python on your computer.
You will learn how to use Python in machine learning or artificial intelligence. All the
materials you 're going to learn in this course will apply to the latest version of Python as
well. At the time of recording this video the latest. version is python 3. 7. 2. Chances are in
the future , when you are watching this tutorial there is a newer version of. Python available.
The first time we run pycharm we 're going to get this warning because this is an application
that we download from the internet. So let 's go ahead and open it every time you open it,
click on create new project. Make sure that base interpreter is set to Python 3. Mac
computers come with an older installation of Python, that 's Python 2. It 's considered legacy
which means it 's no longer maintained or supported. So by convention, all Python files
should have this py extension.
Python interpreter executes our code line by line from the top. On the second line we can
update the value of this price variable , so we can reset it to a new value like 20. On line 2,
we can define another variable called rating and set it to number 4. 9. Now note that Python
is a case sensitive language. Python is sensitive to lower case and upper case letters. In this
tutorial, I 'm going to show you how to receive input from the user. So we 're going to write a
small program that asks the user 's name and then we 'll print a greeting message
customized for that user. In Python we also have functions for common tasks such as
printing messages, receiving input , and so on. Mosh has created a cheat sheet with
summary notes to review the materials in this course. The link is below this video. So I have
done my best to create the best possible Python course on Youtube. And I really appreciate
it if you support my hard work by liking this video and sharing it with others.
We 're going to write a program that will ask the year that we were born in and then it will
calculate our age and print it on the terminal. Python does n't know what to do with
subtraction. So whenever you see this message , that means there is something wrong with
your program. Python does n't know how to interpret or how to evaluate this expression. To
fix this problem we need to convert this 1982 into an integer and then we 'll be able to
subtract it from 2019 and that is easy. I want you to write a program ask the user their weight
and then convert it to kilograms. In this tutorial, you 're going to learn more about Python
strings. So I 've defined this course variable and set it to Python for beginners. defined
another variable weight_kg we set this to weight_lbs times 0. 45. And finally let 's print
weight underline kg. Let 's run this Python program and see what happens.
We use square brackets to get a character and a given index in this string. The index of the
first character in the string is 0. We can also use a negative index here. This is one of the
features that we do n't have in other programming languages as far as I know. The square
bracket syntax is pretty important if you 're preparing for online python tests or college
exams. So with this syntax , you can basically copy or clone a string. So once again the
square bracket. brackets syntax works , we can also use a similar syntax to extract a few
characters instead of 1 character. In this tutorial, we 're going to look at formatted strings in
Python programming language. Formatted strings are particularly useful in situations where
you dynamically generate some text with your variables. Let 's say we want to print this on
the terminal. So I 'm going to run this program there you go. This is what we get.
This is particularly useful when you receive input from the user. Using this , len function we
can enforce a limit on the number of characters in an input field. In this Python tutorial we will
, show you some really cool things you can do with Python strings. When a function belongs
to something else or is specific to some kind of object, we refer to that function as a method.
In contrast len and print are general purpose functions, they do n't belong to strings or
numbers or other kinds of objects. To access these functions we use the dot operator. There
are times that you want to check the existence of a character or sequence of characters in
your string. In those situations you use the in operator to check if this string contains the
word python. The in operator produces a boolean value and I get true or false. The replace
method is case sensitive so if you pass beginners all in lowercase, this method is not going
to find this exact word in our string.
We can use the len function to count the number of characters in a string , this is the general
purpose function built into python. We also have specific functions for strings which we refer
to as methods. These include upper for converting a string into uppercase and lower and title
methods. You learn about the find method which returns the index of a character or
sequence of characters. augmented assignment operator is a way to write the same code
but in a shorter form. It 's not about python programming language. So all the other
programming languages behave the same way. The multiplication operator has a higher
precendence which means it 's applied first which means 3 x 2 is executed first. The result is
6 and then its added to 10 when the multiplication operator is applied first. In Python we
have a handful of built in functions for performing mathematical operations. If you want to
write a program that involves complex mathematical calculations you need to import the
math module. A module in Python is a separate file with some reusable code. We use these
modules to organize our code into different files. In this tutorial we 're going to look at a few
useful functions for working with numbers.
In Python we have this math module which contains a bunch of rustable functions for
performing mathematical calculations. For example you can call the seal method to get the
sealing of a number. There are so many functions built in this module and we do n't really
have time to go through all of them. But let me show you how we can learn about them on
your own. Pycharm shows you how to write a program that simulates these rules. In this
case, we want to tell the user hey it 's a hot day, drink plenty of water. And otherwise if it's
either hot or cold , we want the user to say it ''s a lovely day. So let me show you how you
can simulate these rules with pycharm. If it's not hot it does n't necessarily mean that it 's
cold. So the absence of heat does not mean its cold. We need to use an el if statement to
define a second condition. So after our first if statement , we can use an El if statement. This
is short for els if or otherwise if , now here we add another condition so is cold.
If statements are very useful in programming and with these we can build all kinds of rules
into our programs. Imagine the price of a house is 1 million dollars. Now if the buyer has
good credit they will need to put down 10 percent of the price. Write a program with these
rules an display the down payment card for a buyer with good credit. You will see my
solution next. If both conditions are true then this message will be printed. If one of them is
false then we 're not going to see this message anymore. If we change either of these
conditions to false then the message disappears. With the logical and operator both
conditions should be true. We also have another logical operator called not and that inverses
any boolean value we give it. This is all about the logical operators in python. In this tutorial I
'm going to talk to you guys about comparison operators in Python. We use comparison
You will learn how to use Python in machine learning or artificial intelligence. All the
materials you 're going to learn in this course will apply to the latest version of Python as
well. At the time of recording this video the latest. version is python 3. 7. 2. Chances are in
the future , when you are watching this tutorial there is a newer version of. Python available.
The first time we run pycharm we 're going to get this warning because this is an application
that we download from the internet. So let 's go ahead and open it every time you open it,
click on create new project. Make sure that base interpreter is set to Python 3. Mac
computers come with an older installation of Python, that 's Python 2. It 's considered legacy
which means it 's no longer maintained or supported. So by convention, all Python files
should have this py extension.
Python interpreter executes our code line by line from the top. On the second line we can
update the value of this price variable , so we can reset it to a new value like 20. On line 2,
we can define another variable called rating and set it to number 4. 9. Now note that Python
is a case sensitive language. Python is sensitive to lower case and upper case letters. In this
tutorial, I 'm going to show you how to receive input from the user. So we 're going to write a
small program that asks the user 's name and then we 'll print a greeting message
customized for that user. In Python we also have functions for common tasks such as
printing messages, receiving input , and so on. Mosh has created a cheat sheet with
summary notes to review the materials in this course. The link is below this video. So I have
done my best to create the best possible Python course on Youtube. And I really appreciate
it if you support my hard work by liking this video and sharing it with others.
We 're going to write a program that will ask the year that we were born in and then it will
calculate our age and print it on the terminal. Python does n't know what to do with
subtraction. So whenever you see this message , that means there is something wrong with
your program. Python does n't know how to interpret or how to evaluate this expression. To
fix this problem we need to convert this 1982 into an integer and then we 'll be able to
subtract it from 2019 and that is easy. I want you to write a program ask the user their weight
and then convert it to kilograms. In this tutorial, you 're going to learn more about Python
strings. So I 've defined this course variable and set it to Python for beginners. defined
another variable weight_kg we set this to weight_lbs times 0. 45. And finally let 's print
weight underline kg. Let 's run this Python program and see what happens.
We use square brackets to get a character and a given index in this string. The index of the
first character in the string is 0. We can also use a negative index here. This is one of the
features that we do n't have in other programming languages as far as I know. The square
bracket syntax is pretty important if you 're preparing for online python tests or college
exams. So with this syntax , you can basically copy or clone a string. So once again the
square bracket. brackets syntax works , we can also use a similar syntax to extract a few
characters instead of 1 character. In this tutorial, we 're going to look at formatted strings in
Python programming language. Formatted strings are particularly useful in situations where
you dynamically generate some text with your variables. Let 's say we want to print this on
the terminal. So I 'm going to run this program there you go. This is what we get.
This is particularly useful when you receive input from the user. Using this , len function we
can enforce a limit on the number of characters in an input field. In this Python tutorial we will
, show you some really cool things you can do with Python strings. When a function belongs
to something else or is specific to some kind of object, we refer to that function as a method.
In contrast len and print are general purpose functions, they do n't belong to strings or
numbers or other kinds of objects. To access these functions we use the dot operator. There
are times that you want to check the existence of a character or sequence of characters in
your string. In those situations you use the in operator to check if this string contains the
word python. The in operator produces a boolean value and I get true or false. The replace
method is case sensitive so if you pass beginners all in lowercase, this method is not going
to find this exact word in our string.
We can use the len function to count the number of characters in a string , this is the general
purpose function built into python. We also have specific functions for strings which we refer
to as methods. These include upper for converting a string into uppercase and lower and title
methods. You learn about the find method which returns the index of a character or
sequence of characters. augmented assignment operator is a way to write the same code
but in a shorter form. It 's not about python programming language. So all the other
programming languages behave the same way. The multiplication operator has a higher
precendence which means it 's applied first which means 3 x 2 is executed first. The result is
6 and then its added to 10 when the multiplication operator is applied first. In Python we
have a handful of built in functions for performing mathematical operations. If you want to
write a program that involves complex mathematical calculations you need to import the
math module. A module in Python is a separate file with some reusable code. We use these
modules to organize our code into different files. In this tutorial we 're going to look at a few
useful functions for working with numbers.
In Python we have this math module which contains a bunch of rustable functions for
performing mathematical calculations. For example you can call the seal method to get the
sealing of a number. There are so many functions built in this module and we do n't really
have time to go through all of them. But let me show you how we can learn about them on
your own. Pycharm shows you how to write a program that simulates these rules. In this
case, we want to tell the user hey it 's a hot day, drink plenty of water. And otherwise if it's
either hot or cold , we want the user to say it ''s a lovely day. So let me show you how you
can simulate these rules with pycharm. If it's not hot it does n't necessarily mean that it 's
cold. So the absence of heat does not mean its cold. We need to use an el if statement to
define a second condition. So after our first if statement , we can use an El if statement. This
is short for els if or otherwise if , now here we add another condition so is cold.
If statements are very useful in programming and with these we can build all kinds of rules
into our programs. Imagine the price of a house is 1 million dollars. Now if the buyer has
good credit they will need to put down 10 percent of the price. Write a program with these
rules an display the down payment card for a buyer with good credit. You will see my
solution next. If both conditions are true then this message will be printed. If one of them is
false then we 're not going to see this message anymore. If we change either of these
conditions to false then the message disappears. With the logical and operator both
conditions should be true. We also have another logical operator called not and that inverses
any boolean value we give it. This is all about the logical operators in python. In this tutorial I
'm going to talk to you guys about comparison operators in Python. We use comparison