Python Course | Python Tutorial for Beginners | Intellipaat
- December 24, 2023
- Posted by: MainInstructor
- Category: BASIC C Data Science Game Development Go Java Node Python Web Development
Video Title: Python Course | Python Tutorial for Beginners | Intellipaat
Hey guys welcome to Intellipaat So as we all know that Python developers are in huge demand right now. Why well Because Python is a versatile language that is used in so many domains. For example web development
Machine learning data science automation and so many more. So if you wanna career in any of these domains then it makes sense to learn python right. So in the spirit of helping you master python, we have come up with this end to end Python video that has everything that you will ever need
Before we move forward. Do subscribe to Intellipaat youtube channel so that you never miss out on our upcoming videos. Now. Let’s start this video by looking at the agenda. So this video starts with a brief introduction to Python. After that comes a full-fledged Python tutorial.
You will learn Python end to end. And by the end of it, you’d also be able to core in python confidently. After that comes a Python project. Which will help you enhance and polish your coding skills. And then finally this video ends with the most asked Interview questions onPython to help
Your next Python interview There’s also shot quizzes in between the video to recap whatever you’re learning from this video so make sure you put your answers in the comments section below to know if you are correct Also if you want to become a professional python developer you can take up intellipaat
Python training courses to learn more about the course. You can visit the lake mentioned the description box below to know without any further delays. Let’s get started. What is python. Well in technical terms python is a general purpose high level interpreted
And dynamically typed programming language created by Guido van Rossum. Now you must have heard this definition a lot. But what do all of this technical jargon mean. Let’s understand them one by one starting with General Purpose language. A language designed to
Be used for writing software in various application domains without being restricted to a particular domain. Basically what it means is that python is used in a variety of fields unlike domain specific languages high level language a programming language that uses natural language element
Which makes it a lot easier to read and understand the code. A high level language also automates significant area of computing while coding like memory allocation and management interpreted language. Python is an interpreted language which means that
Your python script is saved and executed in the same format in which you created the script as opposed to the combined languages where the code is first translated to a set of machine specific instructions and then saved as an executable file dynamically type language
Being dynamically typed means that the python parser automatically infers or identifies the type of variable on the basis of what kind of data you have assigned to the Variable Which means that you don’t need to worry about diclaring a number correctly that was stored the
Sum result of an Integer and a decimal. How convenient is that. Now that we fully understand what is Python. Let’s move on to the next topic and understand what are the various reasons for choosing fighting over other languages. Well the very first factor that attracts the majority
Of the coders to a programming language is the ease of learning and python by its very nature is designed to be easy to read and the syntax of Python and can be easily understood even by the beginners. Not just easy to read and write.
Python is also free and open source not being open source means that the source code for this language is available for the public to download use modify and distribute. This may be the primary reason that Python has been evolving over the years and even though
It’s over 20 years old it’s still one of the top languages of 21st century Python also usually involves less code lines which in turn results in less time to write the code. So something as simple as a hello world program takes at least two to three lines of code
And other languages while in Python it just takes one line. Now I don’t know about you but I feel that’s quite amazing. Python is also approved by data scientists. Python is so versatile in nature. No wonder it is increasingly becoming the top preferred language
For data science. So if you’re looking for a career in data science that’s all the more reason for you to choose python. Python also has a huge community which means that in case you get stuck there’s always going to be someone out there you can reach out for help and the
Best part about choosing Python is that it opens up a plethora of Career opportunities for you since it has so many applications in so many domains. We’ll talk about the applications in the Detail but first let’s go over some of the main and important features of Python Python follows object oriented programming paradigm
Which means that programs and Python can be grouped and bundled into individual objects making the codes look neat and easy to understand now. That’s just one of the many advantages of being object oriented python is also a cross platform language which means that a
Python program written on a window system will also run on Linux system but little or no modifications required. Python has an amazingly large and rich collections of libraries Which are also cross platform compatible. This provides users with a lot of flexibility while walking in Python. Python is known for
Its simplicity and it’s very easy to use which is something we cannot really say about majority of the languages out there. Python can also be integrated with other programming languages such as C C++ Java and many more. Now we have already discussed that this of Python is very
Easy to understand its English like elegant syntax is what that makes Python stand out the most among other languages. Now that we know all the main features of Python let’s move forward and learn about the top trending applications of Python.
The first one being web applications python is used to create Web applications of different levels of complexity not just web application development python is also used for data analysis due to abundance of libraries such as numpy pandas and more. Python is leading and preferred
Choice for data analysis machine learning Python can also be used for machine learning to implement predictive analysis by using its machine learning libraries such as scikit learn to flow and many more game development. Python is also very popular in the field of game development as it has an entire module
Named by a game for this purpose. Hey guys quick info if you want to Kickstart a career with Python and data science domain then you can take up Python with data science course offered by Intellipaat this course will help you master all the major concepts of Python using data science domain
And it also has four major industrial based project to help you understand it better. So now let’s move on with the session automation. Python can also be used to automate repetitive stuff such as sending emails opening a browser and posting a Facebook status and many more.
So far we have discussed almost everything that you need to know about Python before getting started with Python but then without the salary talk discussions like these almost seem incomplete don’t they. So let’s get to it. As we already know that Python is top
Preferredlanguage for data science. The average salary for data scientists is around 127826 dollar per year Not just data science Python is also becoming a default choice for machine learning. The average salary for machine learning developer is at on one forty three thousand six hundred and fifty dollar per year
Even the median salary of a regular Python developer is at on one twenty three thousand four hundred and seventy three dollar per year. So it goes without saying that you could be in a high demand and one of the highest paid professionals.
If you are a skilled Python developer let’s make the session a little more interesting with a short quiz. If you look at the following code block you’ll observe that I have assigned two values to the variable named A the first value is a string and the second value
Is an integer. Now do I think if I run this code block and you give me an error. Well yes or no. Whatever you answer may be. Don’t forget to tell me why in the comments section down below also in the true spirit
Of peer to peer knowledge sharing. Let me give you a hint the answer to this question lies somewhere in the definition of Python. So the very first thing that would be doing is installing python on our system. So I already
Installed Python on my system. For those of you who don’t have it you can download it and get it installed on it. Or we should website www Dot Python dot Slashdot. So let me just show you how easy is it to install a Python on your system.
Let me open my default browser. Now i’ll write here www.python.org/download So as you can see here we have a download option of download Python three point seven node 1. If you want a different vision for Windows Linux or Mac you can just click with
These links. Example if I have windows user and I want a different version of it. Then let’s see. I click the link. And you can download different versions of python from you. So the first two options I got up here is latest Python 3 release Python three point seven
Dot one and latest Python two release Python two point seven dot one five Now these are the two popular version of Python. Now which version Should you download. Well I haven’t started Python 3 in my machine. In the past there was a bit of debate in the coding community about which Python version
Was the best one to learn Python two Python 3 specifically Python two point seven Python three point five or three point seven all right Let me just tell you. Python 2 has a most popular vision for a decade and a half. And is still in demand at certain companies. however
Will more companies are moving from Python 2 to Python 3 for example in 2017 Instagram migrated the majority of the Python code base from Python two point seven. To Python three. As it each new version of Python. It is getting a faster run time
On the other hand nobody is currently working on to make Python 2.7 work faster. Also the community support for Python three is more better. So for someone who wants to learn python programming for beginner i’ll suggest that you should avoid spending time on a
Version that is becoming obsolete. But let’s download by the three for Windows. So let’s directly jump up to our first window and click on Download python 3. 7 0 1. download it. So yeah. its downloaded. Just click over the exe file and follow the installation step
And it will get and start click it. Click on the install Now version Select the drive where you want to install it and click on the next and it will be installed on a machine. So let’s click on the install option. yes.
And the set up will install python on my system. Well if you are starting Python you will find that you will have various options where you can write all your codes and get it executed. By default. We use the python CLI you can use any text editor like notepad
Or notepad plus plus. Or you can even use any python ide. like anaconda which has Jupiter notebook and Spyder pre installed in. Python is majorly based on indentation. So these ide’s will help you a lot way coding and debugging your program.
Hey guys quick info if you want to get started. Got it career with python in data science domain then you can take up Python with data science course offered by Intellipaat this course will help you master all the major concepts of Python used in data science domain
And it also has four major industrial based project to help you understand it better. So now let’s move on with the session. So Python my set up was successful. Let’s close. for this tutorial. I’ll be using Jupiter notebook which is a web based application that will allow me to write my Python codes
On it. It’s very to use and gives me Interactive Data Science environment all right. If you are installing Jupiter notebook and python I would strongly recommend you to use the anaconda distribution which already in use Python The Jupiter notebook and other commonly used packages for starting
With Python. So for downloading it let’s visit the website www.anaconda.com/download Let’s open our default browser. www.anaconda.com/download So as you can see we have a download option up here. Just click go at it an installation will start. Open the downloaded file and follow this series of steps. And install Anaconda on your machine.
So for me I have already installed anaconda in my system. So let me just go with that and open it. Anaconda. Navigator. This might take some time to start. So there is how the anaconda navigator looks like after the installation. From here. I’ll select my Jupiter notebook and had the launch button.
My Jupiter notebook will open in my default browser. So here’s my Jupiter notebook. It opened on the local host with board number 8889 So this is how the Jupiter notebook will look like. So from here. You go into the new Select
Python 3 from the note book And this will redirect you to the python notebook page where you can write all the different sorts of Python codes on it. Ranging from a beginner level to advance one. Now that we have set up our environment for
Coding let me just give you a glimpse of how easy is Python. You want to perform addition. It’s as simple as one plus two equals three. That’s it. All you need to do is one plus
Two hit enter. You’ll get the output. So let’s move it. And let me teach you more about it. So let’s get back to our tutorial and see what’s our next topic. So first topic is Python variable How do you think the values assigned Well for assigning the values that two different
Methods first is assigning single value to a variable. And the next is assigning multiple values to a variable. So let’s start with assigning single value to a variable. You know what. Unlike Java or C++ you don’t have to add any data type for a variable. Just specify the
Name of the variable. For example a equal ten. So depending on your data python will automatically detect the data type of your variable. Which in this case is integer. Let’s see other example. Suppose we have a name as victor. So python will automatically
Detect that this name variable is of database string since it stored the string value. All. Right. Next we have salary us two thousand point two three. So since 2000 point two three is nothing but a floating type. So automatically python will detect that Salary is off a data
Type float. You don’t have to specify a data type to a variable. Let me just show you this example a jupiter notebook. For example I need to store a integer value. So I’ll. Name a variable like A A equal ten
10 is an integer and I’m not specifying any data type for it right hit enter. Since no error is appearing so I guess. It’s correct But what if I just write int a equal to 10
As you can see it gave me an invalid syntax so you cannot use any data type before a variable alright. Next. What if I want to store a string variable. Just like. Name equal. John.alright hit enter Similarly for our floating data type. Salary or any variable name equal.
Two thousand. Twenty three dot two three four. Just simple as that. So now that you have learned how you can assign a value to a variable let’s see how you can have multiple assignment to a same variable. So. Let’s suppose you are assigning three variables as A equal 10.
B 10 and again C. Equals. 10. So. Here we have three variables. And what you have to do you have to assign the same value to all of them. So instead of assigning value one by one what you can just write. You can just write
A equal B equal C equal ten. Alright. And it will be executed without any error. Fine. Now this was simple. Now what if you are to assign different value to each variable. For example I have a variable as X equals 20 Y equal 30 and Z equal 40. So in this case
What you can do for multiple assignment you can just write X comma Y comma Z. Equal 20 comma. 30. Comma 40. It’s as simple as that. Now let me just print any of the two variables
And check if we are correct or not. So let’s. Print. Y and let’s print A. So we go to the output as 30 and 10. Y equals 30 & A Equal 10. Even if we want you just taken by updating
The value like A equal B equals C equal 20. And. This is make it something else like 40. 50. And now print the value of Y and A So you will get the values as 40 and 20. All right. So this was about the assigning single
Value to a variable. We also learned about assigning multiple values to a variable. A Equal B equals c equals 10 In this example we already did. Right. And we got the output. As 2010. So now that you know how you can assign value to a variable So let’s move ahead and start
Our discussion with some basics of Python. So I’ll start with Python token. So what exactly is this python Token. And Python token as the smallest meaningful component. Or it is a very basic component of the source code. The characters are categorized as one of the four class of tokens that describe
Their functions. It can be a keyword. It can be literal. It can be identifier or it can be an operator. Fine. So let’s discuss them one by one starting with keyword. So what are these keywords. Well this keywords are some sort of reserve words which are designed for
A specific purpose. You cannot use a keyword as a variable name or an identifier name. Some of the keywords in Python include. For. If Del break continue. True false etc you cannot use them as a your variable. These words in python have a specific purpose and have a specific meaning to it.
Let’s move ahead. Next is the identifier. Well it is the name that you give to your variable or to your function or to your class. For example if you are defining a variable as A equal ten then the word A or the variable A is defining
The identifier well before you start naming your variables or methods of class. You must know that there are certain set of rules or guidelines for naming and identifer. Let’s see them one by one. So the first one is no character except the under scope can
Be used as an identifier. So what does that mean. Let’s see. So you cannot have a variable name as. AP.@. One two three equal something any value. You cannot have a variable name like this it will throw you in error. Or you
Cannot even have a variable like. A D Dot. W.E. equal. Twenty even this will throw you an error. But instead offered. If you write 80_WE. this would be perfectly fine. Next as keywords should not be used as an identifying the i told you earlier also
Alright. It’s like if you are mentioning some keywords like if equally ten obviously this will tell you an error. Or your writing while equal ten. Then this will give you an error. You can not use any
Keyword as a name of an identifier. that as a name of a variable a class object. Or a function. Next is Python is case sensitive. That is VAR with capital V and V are with small v a two different identifier. Let me show you this. Suppose I mentioned A equal 20.
Capital A equal 10. So what do you think the value should be if I print a. Would it be updated to 10. Or what would be same as 20. Well let’s see. So the output is 20. So it means that Small a
Or the A in smaller case and a an uppercase both are treated differently in Python print capital A alright let’s move ahead. Next. And the last one is first character of an identifier can be a character underscored school but not an integer Well what does this mean. 1280 be equal ten has
This is wrong. 1 2 Or 41@rac equals something. Given this is wrong. But what you can do instead you just specify underscore before this. underscore 41 RAC without the athe rate part as no special character other than underscore is allowed.
Equal ten. So this thing would be accepted without any error. Fine. So this was all about the identifiers. Next comes the Literals. Will literals are the constant use in Python. Or you can see that literals are the data given in a variable or a constant. Basically
There are four different types of literals String literals numeric literal boolean literal and special literal. Let’s have a look at them one by one. Starting with string literals Well you can create a string literal just by enclosing a text within the code. Both single and double quotes are
Allowed in a string literal. For example. You can have a variable as name one. Equal. double quotes. John. And you can even have a variable as name2 equal within single code. John. Or. Maybe James. both are correct You’re not getting any error right. So since you are not getting any error
In the output so it verifies that you can use both the single and codes and string literal OK. Now what if you have multiple line input. So how are you print that Let’s see from multiple line input. multiple Equal. So all you need to do is mention three single codes.
Just three. And after that start writing like string one. And two different line string to. Line three string three. And so on alright again you have to enter using three codes. Fine. Executed. You won’t get any error. And if you print the multi line. You. Get. The output as.
STR 1 STR 2 STR 3 and three different lines. Hey guys. Quick info if you want to get started career with python in data science domain then you can take up Python with data science course offered by Intellipaat this
Course will help you master all the major concepts of Python used in data science domain and it also has four major industrial based project to help you understand it better. So now let’s move on with the session. Let’s get back to the tutorial.
So what was our input. Name one equal John name and equals James friend. Name one name to. And we got the output. Yeah we discussed this. We have a multi line thing within triple quotes. You had a multi line thing in which you needed the output and three different
Lines. So yeah you got it using three quotes. Fine. So this was about these string literal late in the session we’ll see what are the various other function you can perform on these string literal Using some of the python’s existing library.
For now let’s move ahead and let me give you an overview of numerical literal. So what are these numerical literals. And numerical literal this is a character string whose characters are selected from the digits 0 to 9 It consists of assigned characters It can be either positive or negative.
Or it can even contain a decimal point well if the little contains no decimal point. Then it means that it’s an integer. If your number is too long and we are capital L or small
L at the end of the number. It makes it a long number. Or if the literal contains a decimal point it becomes a float. But yes remember that you can only use one decimal point in a number. Have you seen a number with more than one decimal point. Never. Right. Well
Just for the FII I’m not talking about the IP. Right. By the way in Python the value of integers not restricted by the number of width. It can expand to the limit of the available memory. And since the value of the integer depends
On the available memory. So no special arrangement was made in Python for storing large number. So any doubt up in this portion. Well if you have these added and the comments section below. So moving on ahead. Next we have is the boolean literally. Well these boolean
Literal how just two values either true or false. Well remember that both these true and false are also a keyword. So you cannot use them as an identifier. They are generally used when we are dealing with some condition whose
Outcome is either true or false. All right. So this was a body boolean literal. Next. How is this special literal. Well Python has just one special literal as none which is used to specify the field that is not created. Well if you are from a programming background or
You just have a basic knowledge about C C++ or Java. I think you must have heard about the keyword null All right. Well if yes then this null is nothing but the equivalent of null keyword and C C++ or Java. So I hope that you guys have
Understood about a literal. There are many cases where you can use none. Let’s see an example. It’s a self-explanatory example. Just go to it will proceed. nothing needs to be explained in this. So let’s move ahead. OK. I hope that you have understood about literals. So let’s move ahead to operators.
So what are these operators. Well these are some specific character which have a specific task to perform. And based on the function and the task the operators are for those segregated and do. Seven different types of operators. Arithematic operator assignment operator companion
Operator logic operator a bitwise identity and membership operator. Fine. So let me discuss them one by one starting with arithematic operator. With arithematic operators other one which is used to perform some arithematic calculation. So what it does it takes to operate to perform operation on them.
For example two plus three. So here two and three are operating. And a character plus over here is nothing but an arithematic operator. So there are other arithematic operators do. Like plus minus multiplication division mode all these characters are a part of an arithematic
Operator. Let me just show you one more example. Like one plus two. So you have 1& 2 are the operatant and plus sign is The arithmetic operator. One minus two again minuses the automatic operator. Two mode one mode is what the arithmetic operator.
That’s move. Next we have is the assignment operator. Well this assignment operator is used to assign a value to a variable the character which comes under this operator are. Equal to plus equal to minus equal to multiplication equal to an etc. For example you declare
A variable as var equal 10. So this equals to is your assignment operator and is used to assign value to a variable. Let’s get back to our Jupiter notebook and learn more about it. For example I’m defining a variable var equal 10. So this equal does nothing but a assignment operator.
Var plus equals 10. Then again an assignment operator. But what does this mean. So what does this mean. Well it means that var equal. var Plus 10. So if you bring the value of var what do you think the output should be. Well you’ll get the output as 20 since
The value of var is already 10 so 10 plus 10. It’s 20. So the updated value of var is 20. Similarly you can perform var minus equal to 10. And again get your value printed.
So again the updated value of that would be. 20 minus 10 10. So this plus equal to or minus equal to it does generally named as a shorthand. Which means I subtract and assign value to said Same example as mentioned over here like A equal ten A multiply equal
To 10. So it means that equal ten into 10 when you print A you get the output as a hundred. So next we have as comparison operator. Well it is used to compare two values and it returns
True or false as the output. the operators which are apart of it are Less than greater than less than equal to greater than equal to not equal to For example. Let’s see what example
We have up here. A Equal 10 B equal 20 A is greater than B. Obviously 10 is not greater then 20. Right. So it is giving me false as the output Fine. So let’s move ahead. Next is the logical operator. Well these logical operator I used to perform some logical calculation
And the operators are the keywords which are a part of it R and R and not. For example we have A equal is less than 10 and 2 is greater than minus 1. Then print A So you are getting output as false. Okay let’s jump back to our Jupiter notebook
And see why we are getting the output as false So you heard A equal. Ten is less than 10. 2 is greater than minus 1. So if you see we have 2 comparison operator up here. So what
Does the value of 10 less than 10. Since it is a comparison operator so it will give me a false right and is 10 not less than 10. And. tWo is greater than minus 1 this is true. So you can summarize this as. False and true.
So since it’s false and true therefore it equals to false. Well how well do you remember the binary calculation that you had learned in your college. It’s like one dot one. Equals 1 or 1.0 equals zero or one and one equals 1 or 1 and 0 is 0. So consider true as one
And false as zero. So false and 2 is false. That’s why you got the result as false. Now if you print the value of a. You’ll get the output as false. So next how is the bitwise operator so. This. Operator is used to perform the bitwise calculation. This operator includes.
And or. Left shift right shift not. Alright. So let’s see they use one by one. Let’s see the example of what we have up here. So we have seven or five. The output is seven 7 seven and five. The output is five. So how do you think we are getting this output.
Let’s see the calculation. So how does calculated. So if you convert seven into binary form it’s triple 1. And if you can would five into its binary form it’s 1 0 1. Now if you are performing or so basically you’re performing a binding addition on it. And if you’re performing
It and you’re performing a binary multiplication on it. All right. So let’s see. So if you’re performing a binary addition on it. So one plus one is one. One to zero is again one. And again one plus one is one.
So that’s why you’re getting the order of seven and five as seven. Even you can verify this using the calculator. Calculator open a calculator. So seven or five. So you’ll get the output as seven. That’s correct Fine. Next operator that we have got up here.
Is there a till operator or not operator. Well this operator is used to performance not operation. So what does not of seven. What is not of seven. It’s minus eight right. How it is minus eight. Let me just show using a notepad.
Lets open notebook. so seven in it;s binary format with forbids as 0 1 1 1. I like if you perform a not of 7 i.e., Not of. 7. What do you get. All the bids
Would be switched like 0 would be converted to 1 again 1 to 0 again 1 to 0. So you’ll get 1000 and automatically and negative sign would be added at the beginning. So you’ll get minus 1000 in binary form which you convert into decimal you’ll get it as minus of eight.
That’s why. The output of not of seven is minus eight. Next is the left shift and night shift operator. Let’s see what is the output first. For example. I’m trying for a. Right shift. And ten right shift to what is the output two. Let’s see how we
Got the output as two. Open our notepad. Let’s move this. so ten in it’s binary form what it is it’s 1 0 1 0. Well when you’re performing the right shift you’re telling the interpreter that you want to shift your bids towards right.
And how many bits you on the shift is basically two since you have mentioned 10. Right sure 2. All right. So 1 0 1 0 shifted two bits to the right 0 0 and move. 1 0 from the end.
So this is how you are shifting two bits towards right. So you’ve got the result as 0 0 1 0. Now if you convert this into decimal form you’ll get the output as 2 fine. So it’s like you’re trying to push to bits from the left towards the right.
Next we have is. 10 left shift two what or does the output. It’s 40. Let’s see how we got that output again 10 in its binary form is. 1 0 1 0. So when you’re performing a left
Shift it’s like pushing the bits from right towards the left. So ten left shift to is like 1 0 1 0 and you’re adding two bits in the end. Since you are shifting two bits to the left. So you’re getting 1 0 1 triple 0. So let’s convert this into decimal form.
So 1 0 1 triple 0 and its decimal form is what 40. So that is why you’re getting that as early as 40. So. A shortcut trick. Well the short trick is that just start and zeros equal to the number of bits that you want to shift towards the left. Like. For example
I want to perform ten left shift three so my output should be. 1 0 1 triple. 0 and 1 more zero. since I’m moving three zeros. since I’m moving three zeros towards the left. So let’s convert it so it’s. 80. So you’re getting the output as 80. Let’s verify it
Again. Well if you perform ten. Left shift three and you get the output as 80 fine. Well I hope the Bitwise operators clear to you guys. But in case your slightest doubt please add your doubt to the comments section below and we’ll try to reply them at the earliest.
For now we can just move ahead to the. Identity operator. Will these operators are used to test if two operant shades and identity. The operators which are a part of it is and is not. These are basically two keywords
For example X equal ten X is ten it’s true X then X is not ten it’s false. It is just used to test if the operant shares identity or not. The next and the final operator in python as the membership operator. This operator is used to test
Whether the value is a member of a sequence or not. The sequence may be a list. It can be a string or it can be a tuple. I know some of you guys might be thinking What is this list or does this tuple. Guys.
I’d say that. Just be patient. I teach you about them in detail during the session. For now you can just understand that this list is almost same as array that you had already studied in C C++ or Java. It’s almost same as that. And this membership operator it is
Used when you want to check if a certain element is present in a list or not. So let’s see what he does with that a part of it. So well we have in and not in keywords which are a part of this membership operator.
Let’s see an example. So lets the example up here So we have defined a list or you can see we have defined an array which consist of dog cat and wolf. So we are checking for line and
Pet. Since pet is the name of our list. Or an array you can say so we are searching for line impact. So since there is no line in it. So the result is false. Next what you are doing was seeing for wolf and pets
So yeah wolf is present in pet. So we are getting out put as true. So this was all about the python token. So moving on ahead we’ll learn about data type and python. Well Python as Majorly two datatypes. Immutability datatype and mutability datatype. Immutable
Are one which cannot be changed or modified. And mutable are the one which can be changed only. Immutabledata type consist of numbers strings and tuples on the other hand mutable datatype They consist of list dictionaries and sets all like.
So let’s discuss about them one by one starting with. Numbers. So under the topic of numeric literals I’ve already discussed that Python has four different types of numerical literals and integer long integer floating number and complex number. Well I have also told
You that you don’t need to specify the data type of a variable why you’re declaring it. Remember. Python would automatically convert a number from one type to another if it means. Fine. Don’t worry if you want to explicitly convert one datatype to another. You can
Do it using int function long function float function or complex function. You have that option available with you. For now let’s just move ahead and see how we can find the data type of a variable. Suppose I’m declaring a integer variable.
A Equal 10. Let’s define the name. Jill. Now what if I want to check the datatype of These variables. So how can I do that. So for that we have type function. So print the type of variable Or. print the type of. Variable name. Or print the type of. Variable.
Salary fine execut it. Say there’s a. you can see that variable a is of type of Integer Variable the name is of type String and variable salaries of type float. Fine. Let’s get back to a tutorial. So this was about the numbers.
Next as strings. Will anything which is written under the single or double quotes is treated as a string. Let’s perform some operation on string and understand them in detail Suppose I have first string as hello world. My second string is Intellipaat.
Now what if I want to print first character from the string one and the last character from string 2. So how will I do that. Let’s see. So what you can do. Print str 1. and I need the first character. So my first characters index number zero. I’ll just mention SR
1 as 0. And I want the last character from string two right. So print STR 2. If you want the last character to specify minus 1. Execute it. So you got the output as capital H and small t.
Since capital H is the first character from string one small t is The. Last character from string two. So now what if I need to extract hello from hello world. So how will
I do that. What I need to do. Extract. Hello from hello world. It’s all you need to do is print. From string string. One. Hello. Starting from zero. And it should end till zero one two three four should end till five. And execute it so you’ll get the output as Hello.
This is how you can collect the substring from a string. One thing to remember is that if you check the index number of Hello. So it would end at 0 1 2 3 4. 4. Right. So when
You want a substring so you have to mention it as plus 1. So four plus one is 5 So zero 5. It won’t include the fifth portion. Generally if you are extracting a substring the last number which are including that thing is not included. It means that everything which would
Be between zero and less than five. Would come as the substring. Let’s perform some operations on it. So first we have is the find function. So what are these find function. Well this find function returns the position of the string. Let’s take an example. For example. I have a string as STR equal.
Attachment what I need to do I want to find the portion of the substring me from it. So STR dot find an inside that. Mention what do you want to find. Like I want to find a portion of me. That’s executed.
So you got the output as six. Since me starts from six. Zero one two three four five. And. It’s on sixth position. That’s why you got to position as six. Next is replace. Will this replace function as used to replace one character or string with other. Fine. It’s like. What
If I want to replace this Emmy with M so STR dot replace. What I want to replace. First mentioned that I want to replace ME with what I want to replace. It’s m. Fine. Execute it. So you’ve got the output as. Attachment. Attachment. Fine Me is
Replaced with M. One more thing that you can do up here is. Let me just show you. You can convert the word attachment into attach. Let’s see how attach not replace. So what you need to replace from here is Ment and you don’t want Ment from this. So what should you replace
It with. You can replace it with space that’s it. .
-
Sale!
Wireless WIFI Repeater Extender Amplifier Booster 300Mbps
$29.99$14.99 Add to cartWireless WIFI Repeater Extender Amplifier Booster 300Mbps
Categories: Electronics, Wi-Fi Router, Wireless Wi-Fi Extender Tags: 300Mbps, 802.11N, Amplifier, Booster, Extender, mobile wi-fi booster, Remote, WIFI, Wireless, Wireless WIFI, Wireless WIFI Repeater, Wireless WIFI Repeater Extender, Wireless WIFI Repeater Extender Amplifier, Wireless WIFI Repeater Extender Amplifier Booster, Wireless WIFI Repeater Extender Amplifier Booster 300Mbps$29.99$14.99 -
Sale!
Full RGB Light Design Gaming Headset Headphones with Mic
$24.99$14.99 Add to cartFull RGB Light Design Gaming Headset Headphones with Mic
Categories: Electronics, Gaming, Gaming Headsets Tags: Design, Full, Full RGB Light Design Gaming Headset, Full RGB Light Design Gaming Headset Headphones, Full RGB Light Design Gaming Headset Headphones with Mic, Gamer, Gaming, Gaming Headset Headphones, gaming headset wireless, Headphone, Headphones, Headset, Light, Mic, Package, RGB$24.99$14.99 -
Sale!
Wireless BlueTooth Multi-Device Keyboard Mouse Combo
$39.99$19.99 Add to cartWireless BlueTooth Multi-Device Keyboard Mouse Combo
Categories: Electronics, Gaming, Gaming Keyboards, Keyboard Mouse Combos Tags: Combo, Keyboard, keyboard mouse combos, Mouse, MultiDevice, Set, WireKeyboard Mouse Combo, Wireless, Wireless BlueTooth Keyboard Mouse Combo, Wireless BlueTooth Keyboard Mouse Combos, Wireless BlueTooth Multi-Device Keyboard Mouse Combo, Wireless BlueTooth Multi-Device Keyboard Mouse Combos$39.99$19.99 -
Sale!
High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
$199.99$139.99 Add to cartHigh Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
Categories: Gaming, Gaming Chairs Tags: Adjustable, Chair, computer chairs, Desk, Executive, Gaming, Girl, Headrest, High, High Back Leather Executive Adjustable Swivel Gaming Chair, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar, High Back Leather Executive Adjustable Swivel Gaming Chairs, Leather, Lumbar, Office, Racing, Swivel$199.99$139.99 -
Sale!
Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
$29.99$19.99 Select optionsProfessional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
SKU: N/A Categories: Electronics, Gaming, Gaming Headsets Tags: Cancelling, Gaming, Gaming Headphones with Noise Cancelling Microphone, gaming headset, Headphones, Headset, LED, Light, Mic, Microphone, Noise, Professional, Professional LED Light Wired Gaming Headphones, Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone, Wired, Wired Gaming Headphones, Wired Gaming Headphones with Noise Cancelling Microphone$29.99$19.99 -
Sale!
Gaming Desk with LED Lights USB Power Outlets and Charging Ports
$349.99$249.99 Select optionsGaming Desk with LED Lights USB Power Outlets and Charging Ports
SKU: N/A Categories: Computer Desk, Gaming, Gaming Desk Tags: and Charging Ports, Charging, Desk, Desks, Gaming, gaming desk with led lights, Gaming Desks with LED Lights, Home, LED, Lights, Monitor, Office, Outlets, Port, Power, Room, Stand, USB, USB Power Outlets, White, Workstation$349.99$249.99 -
Sale!
Wired Mixed Backlit Anti-Ghosting Gaming Keyboard
$99.99$79.99 Add to cartWired Mixed Backlit Anti-Ghosting Gaming Keyboard
Categories: Electronics, Gaming, Gaming Keyboards Tags: Antighosting, Backlit, Blue, brown, Gaming, Gaming Keyboard, gaming keyboards, gaming keyboards and mouse, Keyboard, Laptop, Switch, Wired, Wired Mixed Backlit Anti-Ghosting Gaming Keyboard, Wired Mixed Backlit Anti-Ghosting Gaming Keyboards, Wired Mixed Backlit Gaming Keyboard$99.99$79.99 -
Sale!
Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
$119.99$59.99 Add to cartWireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
Categories: Electronics, Gaming, Gaming Headsets Tags: 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, ANC, Audio, Bluetooth, Cancellation, Ear, Earphone, gaming headset, Headphones, Headset, Hi-Res Over the Ear Headphones Headset, HiRes, Noise, Wireless, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Headphones, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headsets$119.99$59.99 -
Sale!
Wired Sports Gaming Headset Earbuds with Microphone
$19.99$9.99 Select optionsWired Sports Gaming Headset Earbuds with Microphone
SKU: N/A Categories: Gaming, Gaming Headsets Tags: Accessories, Earbud, Earphone, Earphones, Gaming, gaming headset with microphone, Headphones, Headset, IOS, Microphone, Sports, Wired, Wired Sports Gaming Headset Earbuds, Wired Sports Gaming Headset Earbuds with Microphone, Wired Sports Headset Earbuds$19.99$9.99 -
Sale!
150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
$49.99$29.99 Add to cart150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
Categories: Charging Stations, Electronics Tags: 150W, 150W Charging Station, 150W Universal Multi USB Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Stations, 150W Universal Multi USB MAX Charging Station, 16 Port MAX Charging Station, 3.5A, Charger, Charging, Fast, laptop charging stations, Max, Multi, Port, Stand, Station, Universal, USB$49.99$29.99
Guys, which technology you want to learn from Intellipaat? Comment down below and let us know so we can create in depth video tutorials for you.:)
I am learning python because I want full marks in partical exam
And thanks you didi for very well explanation
Print (a)=100
thon
100
thanks alot for this classes
A python revolution started…😮😮
Python opps concepts
I am in class 12 lwant to prepare it for board is this video help me board ke level ke liye ye jyada to nhi hai
0
Really great❤
Database management system and Cyber Security
Java
THANK GOD A INDIAN THAT MAKES THE CONTENT IN ENGLISH!!! JUST COZ OF THAT, I WILL SUBSCRIBE AND WATCH THE VIDEOS!!!
PS: Cheers from Brazil!
X,😚
Nice video 😢😮😅😊😊😊😊
Why we are removing the digits in right shift but not removing the digits in left shift, in example 10>>2 the answer is 2 and in 10<<2, the answer is 40 in Bitwise operator, Can
anyone explain?
Hi I'm taking the course The course is pretty good and well organized and i'm stuck at the pySpark.. The java is installed and i was using GitBash i set all variables like setx but when i run pyspark –master local[2] i get the error $ pyspark
bash: pyspark: command not found
Can you guys please reply ASAP so i can continue the course.Thank you
hi im 9 and i have a dream to make a game so i will need any help i get so thank you so much
Can i get that ppt
2:48:20
1:30
clarification between arange and linspace please.
Clickbait!!
Thanks you 💖💖💖
Thank you Intellipaat ❤
I am using replit and coding from my phone.
This video is so much valuable for me ❤
Please create a video of how to apply Python using cloudera machine learning software
No, I don't think it will give you problems because the first one is a string while the second one is an integer
What is the Ascc value means
Can you explain
could you please solve the first quiz answer I'm unable to produce the output
I am learning python but not able to code my self for programs what can I do please suggest me sir.
thon
Order of dec &bec numbers send
Mam please make video's on Java mam it will helps us a lot
1:no error
2:def myfunction (fname,lname):
print (f.name)
3:def myfunction(x):
print (x)
print (x+10)
4:4
5:r=lambdax,y,z:x+y+z
r(12,12,12)
print(r)
6: 22
@2.00.47 pip works only on cmd not in editor
please i want to learn coding as a professional.what i mean is that can i get a class online where i will start coding as a beginner
Likez et Abonnez-vous massivement chers Patriotes🌶🌶🌶🌶🌶🌶🔥🔥🔥🔥🔥🔥♥♥♥♥♥♥
Send pdf link
100