Python tutorial for beginners

Unformatted text preview:

Python tutorial for beginners Instructions on how to install Python on your computer Python 3 6 3 And so once we open up that file we re going to see a lot of different files and folders inside of it and one of the files that we re going to want to look at is this file called requirements Txt and inside of that file You ll see a list of different Python packages that we need in order to be able to code in Python 3 SO for our purposes Today we re only going to be using the following two packages UNK Numpy and Pandas So now that we have those two packages installed We re ready to start learning how to code in Python 3 We need to choose a text editor So we re going to be writing a bunch of code So we re going to need some environment of some program that we can write We can write all that code in and really you can write Python in any text editor You could write it in like a note pad or tax at it it does n t really matter but there are special text editors that are designed just for writing Python code and these are called id ease and not stands for integrated development environment it s basically just a special environment where we can you know ron and execute our Python code and it ll you know basically like tell us how we re doing so were the only if we write something that s wrong or we have errors It ll kind of point us in the right direction of what we need to do to fix that stuff So in this course we re going to be using an idea and one of my favorites and one of the most popular Ity ease for Python is called Pi charm so I m over here on this website it s called Jet brains dotcom forward slash Pi charm and this is the idea that we re gon na be using in this course So I m just gon na come over here and click this big download now button and we ll go ahead and download this pie charm program right so I m getting this page are here you can see there s two versions of Pi charm one as a professional version and that one s like paid They have to pay for it But then there s this community version down here and that s free and open source so I m going to download this one one and this should have everything we need to get started using Python right when that finishes downloading I m just going to pull that up in my downloads Folder all right so now have pi charm and we have Python three installed on your computer so we re ready to start programming in Python In this tutorial we re going to create our first Python program and we re going to be able to run it and see how everything works NK world our programs are going to be and so that s really what we re going to be looking at in This tutorial is how we can go ahead and write more complex Python programs Of the print statements that are inside and then it s actually printing out the information that is inside of those parentheses onto the consul This Passage provides general insights about how Python works including the order in which instructions are executed Additionally the passage discusses the use of variables which are a fundamental feature of Python programming IT is good practice to use variables in your code to make it easier to manage data IN This passage the author has written a story in Python and has mentioned the character s name and age multiple times However in order to change the name and age of the character he has to go through every line of the text and manually change them This is not a good way to manage data and using variables would make the task easier the variable that I created called character name So now I can just say this print statement will print out the character s name which is John and then I m going to have to have to do the same thing with the character s age which is thirty five So now I can just type in print statement will print out the character s age which is thirty five Along with this string so I click play and it s as five my favorite number if I was to get rid of this string right here and I was not converting the number into a string Now Pythons Gon na have a problem with this it s not going to allow us to do that you can see we get an error so anytime you want to print out a number next to a string You got ta make sure that you use that little string function so there s a bunch of other stuff that we can do with numbers and a lot of times in python you re Gon na want to be using specific metabolic more advanced math operator So there s a bunch of different math functions that we can use on our numbers and a function is basically just like a little collection of code that does something so A function could perform an operation like a mathematical operation on our number We can also give us information about our number So I m sure you guys some of the most common functions that you ll be using in Python related to numbers The first one is called abs and it stands for absolute value So we can get the absolute value of a number and so over here I m going to make this variable negative five and basically I can just say Abs and I can make an open enclosing parentheses over here and this is going to give me the absolute value of this number up here so when I click the play button you ll see it s just giving us five because five is the absolute value of negative five I can use a few other functions There is another one which is called pau at so it says P O W and I m actually not going to use this variable we just as a normal number and this function is going to allow us to pass it to pieces of information So I can give this function two pieces of information The first is going to be like a number and the second is going to be the power that I want to take that number two So I could say like three comma two and this is basically just going to be three raised to the power of two so it s just going to be three squared so we should get nine down here you can see that we do so I could pass in like …


View Full Document

Python tutorial for beginners

Download Python tutorial for beginners
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Python tutorial for beginners and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Python tutorial for beginners 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?