Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
29 views

Python Tutorial For Beginners

This passage provides instructions on how to install Python and set up a development environment. It discusses downloading and installing Python 3.6.3 as well as important Python packages like NumPy and Pandas. The passage also explains how to download and use PyCharm, a popular integrated development environment (IDE) for writing and running Python code. Key steps include downloading Python, verifying required packages, and downloading the free community version of PyCharm to get started with Python programming.

Uploaded by

Sandeep Neelam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Python Tutorial For Beginners

This passage provides instructions on how to install Python and set up a development environment. It discusses downloading and installing Python 3.6.3 as well as important Python packages like NumPy and Pandas. The passage also explains how to download and use PyCharm, a popular integrated development environment (IDE) for writing and running Python code. Key steps include downloading Python, verifying required packages, and downloading the free community version of PyCharm to get started with Python programming.

Uploaded by

Sandeep Neelam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

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 you know
some crazy number like we could pass in a four and we could raise it to the power of six, and so
we should get like a pretty big. number here and you can see we get four thousand ninety-six so
this power function is really useful for taking numbers to specific powers Show you all the
different ways that you can calculate the square root of a number. So it's going to have like a lot
of different options here. So let's take a look at one example okay. so I have a number here. and
I want to find out how to square root it so I can find out how many decimal places it 's going to
go into and so what I'm going to do is I'm going to use the square root function and what this is
Gon na do is It 's gon na take this number and it 's gon na divide it by two and then it 's gon na
take the result of that and that 's. That 's going to give me the square root of this number okay.
So in this case. It 's going to be. six point oh two so that'll tell me that the square root of this
number is two point oh-four okay.. The user will type in their name and then we'll say bye and
then they 'll hit enter and then Python will take the information that the user types in and then it
will store it inside of a variable and that's how we can actually get input from someone in
Python.
Passage to learn about programming. The Passage discusses how to access and use user
input in a program.. The code uses a variable called name to store the input from the user.. The
code then prints out the string "hello, ", followed by the user's name, and prints out their age..
The code also allows the user to enter another variable, such as their age,, which is then stored
in the name variable. When. The user runs the program, they can type in their name and age
and the program will greet them with those values.. The Passage provides insights into the
[UNK] [UNK] to create a basic calculator in Python [UNK] to get input from users [UNK] to add
numbers together. The Passage discusses how to convert a string entered by the user into a
number.. The first function to be discussed is int, which converts integers into a string.. THe
second function to be discussed is float, which converts decimal numbers into a string..

the value that I put over here on the right. And so in our case, it 's going to give us back the
value of 1. So that 's how we can use the return statement to actually execute our code and
have it print out what we wanted it to so. That was pretty simple and basic just a function that
will cube a number. So when we call it. We're going to take it to the power of three right. So if I
was going to Cuba like to be like two raised to the power of three right. It 's just pretty basic
math. Actually do something a little bit different so. I 'm going to do a different function where I'm
not going to use a return statement at all. So basically what I'm going to do is I 'm going to
create. going to create a function that takes no input and just returns a value. So what I'm going
to do is I'm gon na create a function called empty and for this function empty is just going to
return the value zero.. Now what I want to do is. I want to create a variable called result and I 'm
just going to set it equal to empty. For this variable result is just going to store the value that gets
returned from the empty function, since it doesn't take any input. So now if I came down here
and printed out result. it 's actually just going to turn out zero again because that's the value that
it 's storing. So this empty function can be really useful for like getting information back from a
function like for something like an output like in this case. In this case, we're printing out the
answer down here so when I play this you 'll see down here says zero, so we got the correct
answer. So if I wanted to print something out like every time that the empty function gets called,
I could do something like this. I could use a for-loop and just keep printing out the value that
gets returned from the empty function.. So, for example, if we run this program. you can see
down here that when we run the empty function, it's been called once and then when we run the
cube function. It's been called twice and the cube function actually printed out twenty-seven on
both occasions because the empty function returned the value of zero.. So, this is another way
of using return statements where we're not actually returning anything back. We're not actually
returning anything back to the caller. In this case it's just simply returning a value. Going to bring
our sunglasses. so that 's really the basics of an if statement and you see these all the time in
your everyday life..

You might also like