Python Full Course for Beginners Part-1 — Transcript

Comprehensive Python introduction covering features, history, applications, and top companies using Python in 2018.

Key Takeaways

  • Python is a leading, versatile programming language favored for its simplicity and broad applications.
  • Its interpreted and interactive nature makes it ideal for beginners and rapid development.
  • Python's code is significantly more concise compared to languages like Java and C++.
  • The language has evolved through multiple versions, with Python 3 being the future focus.
  • Major tech companies rely heavily on Python for various critical applications.

Summary

  • Introduction to Python as a high-level, object-oriented, open-source scripting language.
  • Comparison of Python's popularity with other languages in 2018, highlighting Python's leading usage.
  • Explanation of Python's features including interpreted nature, interactivity, object-oriented support, and beginner-friendliness.
  • Comparison of Python code simplicity versus other languages like C, C++, and Java.
  • History of Python from its inception in 1989 by Guido van Rossum to Python 3.x versions.
  • Overview of Python applications in web development, automation testing, data analysis, AI, and machine learning.
  • Listing of top companies using Python such as YouTube, Facebook, Google, IBM, NASA, and Dropbox.
  • Emphasis on Python's platform independence and ease of installation on multiple operating systems.
  • Discussion on Python's influence from ABC and Modula-3 languages.
  • Encouragement to start programming with Python due to its simplicity and widespread use.

Full Transcript — Download SRT & Markdown

00:01
Speaker A
Hello everyone, this is Bhavan. So, in this video, I'm going to explain what is the introduction to Python, what are the most popular languages we have in 2018, what are the Python features, and we will compare Python with other languages. We will also cover the history of Python, then we'll see Python applications, and finally, we will see what are the top companies currently using Python. Now, let's start. So, introduction to Python. Basically, Python is a high-level object-oriented scripting language. It is an open-source language. Just like Java, Python is also an open-source language. It is freely available, and it is also platform independent. So, we can install and work with Python on multiple platforms like Windows, Linux, Unix, Mac, or other operating systems. Now, let's see the most popular languages currently we have in 2018. If you see the multiple languages here, Python, C++, Java, Ruby, JavaScript, C, PHP, and C#. Python will occupy the highest percentage, like 29.8% of the people are currently using Python this year. Java is almost 25%, 25.8% of the people are currently using Java. So, when you compare with other programming languages, Python and Java will be very top level. Again, if you compare these two, Python is a language which is very popular coding language according to 2018 in the current year. Now, we'll see what are the different features of Python. Python is an interpreted language. So, what is an interpreted language? In Python, each and every line will be verified. There is a big difference between interpreted and compiled languages. In some programming languages like Java, we use a compiler, which means all the lines of code will execute at once and throw all exceptions and errors. In case of an interpreter, the program will be interpreted or checked line by line during execution. If you find any issue in that particular line, it will throw an exception. So, that's the basic difference between interpreter and compiler. Here, Python is basically an interpreted language, and it is more interactive. Interactive in the sense that Python provides many kinds of command line interfaces where we can directly interact with Python in different ways. Python is an object-oriented language just like Java. Python also supports classes, objects, polymorphism, inheritance, and all kinds of object-oriented programming concepts. Python is a beginner's language. Why is it a beginner's language? Because it is very easy to use. It is just like English kind of statements we have in Python. Nowadays, Python has become very popular because of its easiness. Not only easiness, Python is also used in multiple fields, multiple departments, multiple technologies, and by different top companies. These are the basic features of Python. It is interpreted, interactive, object-oriented, and moreover, it is a beginner's language. So, when you start learning programming, you can start with Python. Now, let's compare Python with other languages. If you want to print a small message like "Hello World" as output, in other languages like C, C++, and Java, we need to write this much code. If you see in C, we need to first specify the include stdio.h, the main method, printf command, and return 0. This much code we have to write in C programming. The same thing in C++, we have to write code like this: include iostream, then the main method, cout, and return 0. The same program, if you want to write in Java, we have to first create the class, and within the class, we need to have the main method, and we need to use the out method. If you come to Python, the same thing we can achieve with a single statement. We don't have any kind of include statements or main methods. We can directly add the print command, which will print the output in the console window. See here, this small thing, if you use other languages, you have to write more steps. But in Python, it can be done within a single line of code. So, if you have only a small task, you can just reduce the code to one line. Suppose if I want to achieve some task in Java, it takes, let's say, 1000 lines of code. We have written for certain functionality in Java. But the same thing if you're writing in Python, it will be completed within 100 lines of code approximately. That's the reason people prefer to use Python for all kinds of fields. This is our basic comparison of Python with other languages. Now, let us see the history of Python, where it started. The implementation of Python was started in December 1989 by Guido van Rossum at CWI in the Netherlands. In February 1991, van Rossum published the code. That labeled version is 0.9.0. The first time in 1991, they published that code. In 1994, Python 1.0 was released officially with new features like Lambda, Map, Filter, and Reduce. Then Python 2.0 added new features like list comprehension, garbage collection systems, and so on in 2.0. On December 3rd, 2008, Python 3.0 was released. This version is also called Py3k. Currently, both Python 2 and Python 3 versions are available. On top of Python 2, we have 2.1, 2.3, and other 2.x versions. There are many versions available. Parallelly, on Python 3, there are multiple versions available like 3.1, 3.2, 3.3, and other 3.x versions. In the future, Python 3 will be implementing new features. They are not going to implement anything on Python 2. Python was basically designed or developed by influencing ABC language and Modula-3. These are the two core languages that influenced Python's development. So, this is the history of Python. Now, let us see what are the different applications or areas where Python is currently used in the market. Especially for development, web development. Suppose we want to develop a web-based application. Python is widely used by web developers. Especially for testing also. Automation testing is also done using Python, especially with Selenium. Along with Java, some people also use Python with Selenium. Another area is data analysis, especially for Hadoop or big data environments. They need to analyze customer data, and for that, they are using Python for analyzing data in data science, artificial intelligence, and machine learning. Almost the latest technologies or whatever applications are newly coming up in the market, Python is used in almost every technology or application. That's the reason it has become very popular. These are the different applications where Python is used as a programming language. Now, let's see what are the top companies currently using Python. Especially YouTube, Facebook, Dropbox, Yahoo, Mozilla, Google search engine, and IBM. These are the top companies using Python rigorously or widely. Especially for NASA, there are a lot of applications using Python. Even in the Google search engine, especially Google search engine, they are using Python. Facebook is also using Python, and YouTube is also using Python for data analysis and everything. These are the top companies currently using Python. All right, so that's all for this video. Thank you all. Please subscribe to my channel to get more updates. Thank you all. Hello everyone, this is Pawan. In this video, I am going to show you how to install Python on Windows. Then I will show you how many ways we can run our Python code.
00:18
Speaker A
other languages and history of Python and then we'll see Python applications and then we will see what are the top companies are currently using Python. Now let's start. So, introduction to Python. So basically, the Python is high-level object-oriented scripting language. So this is
00:40
Speaker A
open source language. So just like Java, Python is also open source language. It is freely available. And it is also platform independent. So we can install and work with Python on multiple platforms Linux, like Windows, Linux, Unix, Mac, or other operating systems. Now let's see the most popular languages
01:05
Speaker A
currently we have in 2018. So if you see the multiple languages here, Python, C++, Java, Ruby, JavaScript, C, PHP and C sharp. And Python will occupy the more percentage like 29.8% of the people are currently using Python in this year. And Java is
01:26
Speaker A
almost 25% 25.8% of the people are currently using the Java. So when you compare with other programming languages and Python and Java will be very top level. And again, if you compare these two, the Python is a language which is very popular
01:43
Speaker A
coding language according to 2018 in the current year. Now we'll see about what are the different features of the Python. So Python is interpreted language. So what is an interpreted language means? In the Python language, each and every
02:00
Speaker A
line will be, each and every line will be verified. So there is more difference between interpreted and compiler and some programming languages like Java, we use a compiler means all the lines of the code will execute at once and throw the all exceptions,
02:16
Speaker A
all errors. In case of interpreter, the, program will be interpreted or checked line by line of execution. If you find any issue in that particular line, it will throw an exception. So that's the basic difference between interpreter and compiler.
02:32
Speaker A
So here the Python is basically interpreted language and it is more interactive. So interactive in the sense that the Python is provided so many kind of command line interfaces where we can directly interact with the Python in different ways. And Python is
02:47
Speaker A
an object oriented language just like a Java. So Python also supports classes, objects, polymorphism, inheritance, all kinds of object oriented programming concepts.
02:59
Speaker A
And Python is a beginner's language. So why it is a beginner's language? Because it is very easy to use. It is very easy to use. It is just like an English kind of statement we have in the Python. So nowadays Python has become
03:13
Speaker A
very popular because of the easiness. And not only easiness, this Python is also used on multiple fields or multiple departments or multiple technologies and by different companies, top companies. So these are the basic features of Python. It is
03:31
Speaker A
interpreted, interactive, object oriented and moreover it is a beginner's language. So over the start learning the programming, you can start with the Python. Now, Let's compare this Python with other languages. Now, if you want to print a small
03:49
Speaker A
message like hello world as an output, so in other languages like C, C++, Java, we need to write this much code. So if you see, if it comes to the C here, we need to first specify the include stdio.h and main method, printf
04:03
Speaker A
command and return 0, this much code we have to write in the C programming.
04:07
Speaker A
And same thing in C++, we have to write code like this, include iostream, and then the main method is cout and return 0. And the same program, if you want to write in Java, we have to first create the class and within
04:21
Speaker A
the class again, we need to have the main method and we need to use this out method. And if you come to the Python, so the same thing we can achieve single statement. Okay, so we don't have any kind of include
04:34
Speaker A
statements or main methods. So directly we can add the print command, which will pin the output as a console window. See here, this small thing, If you use other languages, you have to write more number of steps. But in case of Python, it
04:47
Speaker A
can be done within single line of code. So if you have only 5 to small thing, you can just reduce the code with one line. Suppose if I want to achieve some task in Java, it is taken, let's say, 1000 lines of code.
05:00
Speaker A
We have written for certain functionality in Java. But the same thing if you're writing Python, it will be completed within 100 lines of code approximately. So that's the reason people are going to prefer to use Python for all kinds of fields. So
05:17
Speaker A
this is our basic comparison of Python with other languages. Now let us see the history of the Python, where it is started. So the implementation of Python was started in the December 1989 by Gudu Van Rosem at CW Eind
05:34
Speaker A
Netherland. But in February 1991, Van Rosem published the code. So that labeled version is 0.9.0. The first time in 1991, they have published that code. And in 1994, the Python 1.0 was released officially with the new features like Lambda, Map, Filter, and Reduce. And then Python 2.0
05:58
Speaker A
added new features like list comprehension, garbage collection systems, and et cetera in 2.0. And on December 3rd, 2008, Python 3.0 was released. And this version is also called as Py3k. And currently the Python 2 as well as Python 3, both versions are there. And on top of Python 2
06:20
Speaker A
we have 2.1, 2.3 and 2.x. There are so many versions available. And parallelly on Python 3 also, there are multiple versions available like 3.1, 3.2, 3.3 and 3.x.
06:33
Speaker A
But in future, the Python 3, they are implementing the new features. They are not going to implement anything on Python 2. Okay. And this Python is basically designed or developed by influencing ABC language and module 3. So these are the basic two core
06:48
Speaker A
languages on top by using this. By influencing these two languages, the Python is developed or implemented. So this is the history of the Python. Now, Let us see what are the different applications or areas where the Python is using currently in the market.
07:05
Speaker A
So especially for development, web development. Suppose we want to develop a web based application.
07:10
Speaker A
So Python is widely used by the web developers. And especially for the testing also.
07:15
Speaker A
So automation testing is also people are using the Python as a language, especially for Selenium. Along with the Java, some people are also using Python with Selenium. And the other area is the data analysis. and data analysis and especially for Hadoop or big
07:31
Speaker A
data environment so they need to analyze the data, customers data and for that also they are using the Python for analyzing the data in the data science field or artificial intelligence and machine learning so almost the latest technologies or whatever applications are newly
07:46
Speaker A
coming up in the market so in almost in each and every technology or in each and every application that Python is using currently. That's the reason this has become very popular. So these are the different applications they are using
08:01
Speaker A
Python as a programming language. And now we see what are the top companies are currently using the Python and especially YouTube, Facebook, Dropbox, Yahoo, Mozilla and Google search engines especially and IBM. So these are the top most companies they are using Python rigorously or widely.
08:26
Speaker A
So especially for NASA, there are a lot of applications they are using Python and even in the Google search engine, especially Google search engine, and they are using the Python and Facebook is also using the Python, especially YouTube also using the Python to
08:42
Speaker A
get the data analysis and everything. So these are the top most companies are currently using the Python. All right. So, so that's all for this video.
08:54
Speaker A
Thank you all. So please subscribe my channel to get more updates. Thank you all.
09:00
Speaker A
Hello everyone, this is Pawan. So in this video, I am going to show you how to install Python on Windows. And then I will show you how many ways we can run our Python code. Now let's get started.
09:17
Speaker A
So let's start with the how many ways we can install Python. So before that, let's see how we can install Python on Windows environment. So normally the Python is open source tool. We can just download the installer. Now let's go to the Google.
09:31
Speaker A
So just type download Python. So when you type download Python, you will get to Python official website. Just go here.
09:43
Speaker A
And in this particular website, you will download Python 3.7.0. So this is the latest version is available on Windows. So when I click on this, it will just start downloading the installer.exe file. Okay. And once you get this exe file, you can just
09:58
Speaker A
double click and start installing. So I'm just already have it. So I'm just discarding this. Now, once you get an installer file, so you need to start installer and then you will get, so this is the link you have to download. And once
10:10
Speaker A
you click on the download exe file, you will get this particular screen. click on the install now and it will go and do the setup process and it will take few minutes of time and finally it will end up with a successful message
10:25
Speaker A
so these are just a few screens it will go and it's very simple to install python so once we have done this just close that window okay this is how we need to install windows on this is how we need to install python
10:38
Speaker A
on windows operating system so currently i have installed python 3. okay So once you have installed this Python on Windows, you need to do one more step. So where this Python will be installed by default, the location will be under C drive, under
10:53
Speaker A
program files x86. So under Python 3.6.4, this is the current location where the Python is installed. So we need to configure this path in environment variables. So that's another step we need to do. So let's copy this path. and go to my PC, this PC, go to properties and go
11:15
Speaker A
to advanced assistant settings and it will open up one more window. Here go to environment variables. Now you can see here, let's go to the path variable. Now go to click on edit. Now you can see somewhere I already configured that path of
11:30
Speaker A
the python. If I don't see that particular path, you need to add that particular path here. Let me just click on new and just specify the path like this.
11:41
Speaker A
okay i think somewhere i already added so here you can see i already added my path so i'm just removing this okay so this is how we need to do the configuration first time once we have configured this path and then click on
11:55
Speaker A
ok button now ok button and then ok button so this is how we need to install the python first time so once we have installed this python now i'm going to show you how many ways we can run the code on python So
12:11
Speaker A
there are almost six to seven ways we can run our Python code on multiple environments. Now let me show you one by one. The first method we can execute is the first method.
12:30
Speaker A
Okay, so we can run our code. We can run our Python code by using python.exe file. Python.exe file. This is the first method. Now I'll show you how we can do that. Let me just save this file. Let's say base.
12:47
Speaker A
So we need to, you can execute the Python code in different ways. So Python.exe is the one method. So where we can find this Python.exe file. So we already installed Python and this is the location, right? So go to this location and here
13:02
Speaker A
you can see Python.exe file. Let's click on this Python.exe file and it will open up one command prompt like this. This is a kind of a shell. So here we can directly write our Python code and we can execute. Now let me just
13:15
Speaker A
write a simple code here. So this is your Python.exe file shell window. So here I will just write a small hello world message by using Python code. So here I'll just say print and here in the double quotations I
13:32
Speaker A
will write hello world. And then press enter. So this will give you an output.
13:39
Speaker A
And similarly, I will define two variables. Let's say x is equal to 100 and y is equal to 200. And then I will print x plus y. Let's say print x plus y. Now, this will also give you output as a 300.
13:54
Speaker A
So this is one way of executing the Python code. So by using python.exe file.
14:00
Speaker A
So where we can find this exe file, wherever you have done the installation in that particular location, you can find the exe file. So this is a exe file.
14:10
Speaker A
So this is the first method. So this is the method one. And I'll show you the second method. In the second method, once you have installed the Python, you will get a IDE again. This is also kind of a command
14:26
Speaker A
prompt. So that is, let me just write it here, method two. So in the method two, you have to use IDEN. So this is also command line, like we can call it as a Python shell. Python shell. Now let us
14:43
Speaker A
see how we can run our Python code by using IDEN. So here in Windows itself, let me just close all the stuff. Okay. Let me just close this window also. Now.
15:01
Speaker A
Okay. So now in the Windows, just go here and type IDEN. Okay. So when I say IDEL, so you will get this particular application. IDLE, sorry. This is IDLE shell, which is coming with the Python installation. Now, once you click on this, let
15:18
Speaker A
me just minimize this windows also. OK, now I'm typing here IDLE. OK, so now once you click on IDLE, you will get this particular window. So this is also a Python shell. So here also we can just write our code. So now let me show you how we can write the code
15:42
Speaker A
in the Python shell. Just a second. OK, so here I can just create a print statement and here I'll say hello world.
15:55
Speaker A
So I'll just say hello world. Right, I'll close this one. So when I enter this, this will give you an output message. And similarly, I can also write something else here. I can just write, let's say, x is equal to 100 and say
16:09
Speaker A
y is equal to 200. And now I'll print the sum of x plus y.
16:13
Speaker A
I just say print x plus y. Now it will also give you exact output.
16:19
Speaker A
So this is another way of executing your Python code. Okay, by using IDLE. So this is one of the IDLE. Okay, this is one of the shell we have. This is called as a Python shell. IDL. Right. So
16:37
Speaker A
in this particular shell, okay, this is a fine. So in this particular shell, we have another way of executing your program. So I will tell you that by using file, a new file also, we can do that by using the same IDL. So
16:51
Speaker A
by using a new file. So here we can save the code in a new file and we can run it. Let me just show you that. So this is our Python shell. So in this shell, what I can do is go to file
17:04
Speaker A
and click on the new file. So it will open up one more window like this. Okay. So here I will write a program. Python program. Let me print something called print. This is.
17:20
Speaker A
So I have just written one message and also I will create one more message.
17:24
Speaker A
Print. Okay. So welcome to Python. word okay now I have created two statements in the Python new file so once we have created this let's save this file so go to file and you can save this file any location but we have to give .py
17:45
Speaker A
as an extension so always the Python files will be saved with .py extension now let me store this in the desktop I will give you a name called test.py okay always the Python files will be end with the .py Now let me save
18:01
Speaker A
this on the desktop. Right. So now I have saved. Now how we can execute this now. So we have option called run option here. You can directly use run module. So when I click on this run module, it is executed. Now you will
18:14
Speaker A
see the output here. See now. So here I have executed by using run module and you are getting the output here on the shell. So this is the other way of doing so. Parallel, you can also do the changes here, save it and
18:29
Speaker A
run the program here. Let me just do some changes. So let me add also x is equal to 100 and y is equal to 200. I will print sum of two numbers. Let's say print x plus y. Right. Now again save the file
18:43
Speaker A
and go to run and again click on run module. Now again you will get the output. This is Baban. Welcome to Python world. And you will get the output.
18:52
Speaker A
Okay. So this is how we can just use IDELE. and we can directly write the code in the command prompt like here and also we can write the code in the file and save the file and you can see the output here so
19:05
Speaker A
this is the method number two now I'm closing this okay so in IDL directly we can write in the command prompt or command prompt and we can also create the code or we can also write code so write code in new file and then run it okay
19:30
Speaker A
save and run it so this is another approach we have now i'm going to show you uh another approach so we have so far seen two approaches one is by using the dot exe file and the other one is dot using idle now
19:45
Speaker A
i'm showing you how we can execute through command from keys to our shells python.exe our idl will be open the shells python shells default shells so those shells you will get once we have installed python now i'm going to show you now the
20:00
Speaker A
method 3 so in the method 3 so we can just use a normal command prompt windows command prompt so by using windows command prompt and here one more thing we need to remember So if you want to execute
20:17
Speaker A
your code through Python shells, you no need to add your Python home path to your environment variables. We have already done this before, right? But if you want to execute this, your code through command prompt, Windows command prompt, you must add the path
20:32
Speaker A
to your Windows environment variables. So we already done here, right? So let me just show you once again. So here, this PC, go to properties window and here in advanced settings, and the environment variables right so here in the path
20:49
Speaker A
variable and we already added the python path here home directory path right so this must be there if you want to run your code through command prompt now once we have done this now let me just open a command prompt
21:03
Speaker A
now okay so windows command just type cmd here and it will open up one command prompt so this is your command prompt and in this command prompt i can just type a command called Okay, just I need to type a command called python.
21:20
Speaker A
Okay, so this is a command you have to write. So once you click on, once you have written the python, just press enter. Right, so press enter.
21:31
Speaker A
Yeah, now it is giving the version number and all. But if you don't configure the path in environment variable, it will give you the another message like python keyword is not able to identify the internal external command. So that kind of error you
21:44
Speaker A
will get. So before executing this command here, you need to configure the path in environment variable. That's the first thing you have to do, right? So now here, before writing the program and all, please check, okay? So when I give Python here, it
21:59
Speaker A
will give you the version and it will give the command prompt. So here also we can write your Python code. So let me just write the Python code here.
22:07
Speaker A
So again, I will write print hello world. and then quotations close. Now you can see the same output we are getting. And similarly, if I define a few variables here, let's say x is equal to 100 and let's say y is equal to 50. Now if you want to add them,
22:27
Speaker A
let's say print x plus y. Now it will give you 150 as an output. So this is how we can execute our code using Windows command prompt. Windows command prompt. We need to just write a Python command here keyword and
22:43
Speaker A
then it will give you a command prompt and there you can write all our python code and execute it so this is another approach so by using windows command prompt we can execute our python code okay now we'll see the another approach so method three so method four
23:05
Speaker A
so in the method four So far we have just seen all command windows, right?
23:10
Speaker A
So even Python 30 X will open the command window CLI mode and even IDL also will be there in that CLI mode and windows command prompt is also CLI mode. So all three, these three approaches comes under the CLI mode command line interface.
23:25
Speaker A
Now I'm going to show you how we can write the code in notepad++ or edit++. Either we can use, there are two, any editor is fine. Let's say notepad, plus there is an editor called notepad plus plus and or 80 plus plus we
23:42
Speaker A
have a edit plus two right this is the editor where we can write anything so that's called 80 plus but these two are open source okay so we can write our Python code either these either one of these editors and we can execute
23:56
Speaker A
that code through command prompt again now let me show you how we can do that so here I have a notepad plus plus tool so let me just open this and So this is my notepad++ tool.
24:10
Speaker A
Okay. Now this is my notepad++ tool. Now here I will write a Python code here. Okay. And I need to save this file with the .py extension. Remember this. I need to save this file with the .py extension. Now let me just
24:26
Speaker A
first save the file. Okay. Just save. On the desktop, I will give you my file name is test.py. Test.py and then save it. Now this file is saved with a .py extension. Now I can write a python code
24:41
Speaker A
here. Now I will write again same code. Let's say print welcome to python. So here I have written some code. And also I will write some other code. Let's say print. So this is again one more code.
24:59
Speaker A
print. This is python.py. So I have created a few statements here. Now the save this file. Now this file is already saved with the test.py and where we have saved this file under this particular path. So if you go and click on save as, under this part,
25:25
Speaker A
desktop, we have saved this. So you can see the path at the top, c column, users, admin, desktop, test.py. So this is the location where I have saved this file. So once you save this file, you can close this file or we
25:38
Speaker A
can just minimize. And now we already open the command prompt, right? So we can just close this. Now I'm going to show you how we can execute this file.
25:49
Speaker A
So because right now we have created a file for test.py file, right? So which contains the code, which contains the Python code. And we have also already saved the file somewhere, right? So now how to execute this file test.py file.
26:05
Speaker A
So if you want to execute this again, go to command prompt, receive cmd and write. So here I will show you how to execute this file. So if you want to directly write a command here, you just type a Python keyword here. It
26:19
Speaker A
will give you the command prompt and there you can write all the Python statements that we have seen earlier in the method number three. But in method number four, we are doing the same thing again. We are running the same thing, but here
26:32
Speaker A
we are running the file. So Python file which contains the Python code. Now here I will just type Python. Python. What is the file name here? And before that, where is our file? We need to go to that location or we need to
26:46
Speaker A
give the complete path of the file. So either we need to do one of the way. So either we need to go to the file path. We need to change this path wherever the file exists. .py file. Or we need to give a
26:57
Speaker A
command here. Let's say Python. And we need to give the complete file path here.
27:03
Speaker A
either one of the one of the thing we have to do okay now let me just check where my file is present now my file is present on my desktop now i will get the uh this is here it will give you if
27:15
Speaker A
you right click on the file and see the properties and you will get the path of your file so here i have saved my pf pv file let's go to that directory so cd and give this path and now you will go back
27:26
Speaker A
to your directory and here your file is present dot pv file is present okay now I will execute that particular file. So how to execute the file?
27:36
Speaker A
Test.py file we created, right? So python test.py. So just give the Python as a keyword and specify the name of the Python file, test.py. Now, what we have created as a code, so print. There's two print commands we have created, right? So now when I run this code, let
27:58
Speaker A
me just run this. So now you will get an output. So the same two statements we have executed. Now let me just add some more thing here. In the same file I will just add x is equal to 100, y is
28:11
Speaker A
equal to 200, y is equal to 300. I will print some of these numbers. Print. And 200 plus 300. Now I am printing these two values. Put them in the brackets and save the file. So once you have saved it, minimize this again, run
28:34
Speaker A
the same code again one more time. Now we can see you will get the latest update or latest output. Okay, so this is a other way of executing your Python code. So what is the difference between third and fourth? The third also we
28:48
Speaker A
have opened the command prompt, but here we don't specify any file. So we have just go to Python command prompt that will be shown like this. And here we have executed the commands. all the commands directly without creating any file. But here what
29:02
Speaker A
we have done is we have just created the file which contains the code. Okay, create a new file.
29:14
Speaker A
Okay, or by using either notepad++ or edit++ and add a Python code to that particular file and save the file and then save it.
29:26
Speaker A
So once you have done this, you will get created a test.py file and now we can run this file by using again same command run. So once we have created this, how we need to run? Again, go to that file location and then
29:38
Speaker A
the command is python test.py. So this is how we need to execute the file, which Python file, which contains the code. Now this is the fourth approach. Now I am going to show you one more approach.
30:00
Speaker A
The next one is online compilers. Suppose you have installed Python in your system but there are some issues with your installation of some configuration.
30:11
Speaker A
So you are not able to execute or you are not able to run your programs in your local system. Suppose you have a requirement like you need to immediately verify whether your code is working fine or not. So in that particular conditions you
30:23
Speaker A
can go and use online compilers, Python online compilers. So there are n number of compilers available online. Now if you go to the Google and search for that, just type here Python online compilers. So if you type it, you will see lot of compilers are available online.
30:43
Speaker A
So the best and most, two compilers I am going to show you here. So one is Python 3, this is a one compiler. And there is another compile called ripple.id. So this is also one more compiler you can see here. So these are
30:56
Speaker A
all on-end compilers. So on-spot you can directly type your code and you can verify it here output. And this is one more compiler we have. So here you can write all the code and you will compile it and then you will get the
31:07
Speaker A
output here. Now let me show you the first compiler. This is called a rex tester. So here it is currently using Python 3. and we can just make this layout side by side. Let me just put the origin under so output can be
31:22
Speaker A
seen here. So here I will create some messages. Let's say print. So here I will write this is my Python program. So here I have written some message and once you created this message click on it run here. Run it
31:41
Speaker A
F8 button. Once you click on this button you will see output here. So this is on-spot you can execute online. Suppose if I say here x is equal to 100 and y is equal to 200. If I want to print some of these
31:54
Speaker A
two numbers, I can just say print x plus y. And now again, execute this code. You will see the output here. This is an online compiler. So you can also do and you can also use another compiler. This is very popular
32:10
Speaker A
compiler online like ripple.id. So here, You can just create a code here, write your code here, and then click on this run button. And then you will see the output in the console window. Here you can see the output. So these are all
32:24
Speaker A
online compilers. So there are n number of compilers are available. If you want to execute your Python code on spot online without installing any Python code in your local system, and then go for this. Okay, these are all online compilers. And then, so
32:39
Speaker A
this is a one of the approach. 5th approach method 5 method 5 is by using online compilers here in online compilers there are 2 popular compilers one is this one retester.com The other one is Ripple compiler. So there is another compiler called ripple.it compiler.
33:17
Speaker A
Okay, so I'm writing it here. I'll just give these notes in the description. So this is a online compilers are available. So by using online compilers, we can execute our Python code. And along with this, we have a last methods
33:33
Speaker A
by using IDEs. So IDEs is nothing but integrated development environment. In the method 6 we can use ID. So there are n number of IDs that are available like PyCharm is a very popular ID for Python and we can
33:51
Speaker A
also use Eclipse for writing Python program. So these are two very popular editors for writing and executing your Python code. So first we will see the PyCharm ID.
34:08
Speaker A
So method six is a PyCharm IDE. Let me write it here. PyCharm integrated development environment. And this PyCharm is also a kind of a tool which is open source, again freely available. So we can just download and install this.
34:25
Speaker A
Let me show you from where we can download this. Just type here PyCharm. OK.
34:31
Speaker A
Press enter. Now we will navigate to JetBrains.com. This is a company they have developed this one. and click on PyCharm. So here you can see all the download options of PyCharm. So here, so once we click on this download
34:49
Speaker A
option, you will get more small exe file. Okay, so we already downloaded it. So just I'm not going to download anything. Now you can go here. So let's go for community and professional. There are two versions are available. And
35:03
Speaker A
Community is completely free as well as open source. Let's go for Community Edition. Click on this download and it will start downloading your PyCharm. Before that, here it is started. I already have this exe file, just like discarding it. Once we have
35:20
Speaker A
downloaded this PyCharm and you need to install this software in your system. The complete software you have to install in your system. Just by pressing the exe key, it will go to few steps and it can be easily installable on Windows. Okay, so
35:35
Speaker A
once you have installed PyCharm, so I already installed and now let me just show you how the UI will be. So this is your PyCharm software. So this is our tool, PyCharm tool, where we can write all our Python code. Okay,
35:49
Speaker A
so here the first thing is we need to create the new file and a new project. Let me just create a new project for Python and all these projects will be stored in your PyCharm projects workspace. First time when you open this PyCharm,
36:01
Speaker A
it will ask you for the workspace and then you need to give some workspace.
36:05
Speaker A
This is our default workspace where we can create our programs. Now here I'm going to give a new project name. So here I will give you my project.
36:16
Speaker A
Let's say my test project. My test project. So this is my name of the project. Click on the create and now OK. So as soon as I have done creation of your project, so that project will be appeared on the tree. So let it take some time.
36:45
Speaker A
My test project. So under this project, I can just create all of our Python files. So let me just right click on this project. So if you expand this external libraries, you can see all of it. this on this project I'm going
36:59
Speaker A
to create new time fighting and so here we need to give the name of the file so let me just give us something called test and we need to save this file as a dot e by as a extension the file is created
37:11
Speaker A
here and also it will give you one later here so here we need to write the now here again I read some message print here hello okay now I have given some message in print command Along with this, I will also print some more.
37:32
Speaker A
So, hello, welcome to Python. And hello, welcome to learning. Okay, something. So I have created a few statements in this editor. Now how we can run this? Just click here, run test. Right click here, run test. Now when I click on this, it will give you output here. So in the bottom
37:56
Speaker A
window, you can see the output. Similarly, you can also write some code here x is equal to let's say 100 and y is equal to let's say 200. Now I will print some of these two numbers. Let's say print x plus y and
38:10
Speaker A
again run the code run test and now we will see the output here. So this is again one more popular IDE for Python. But we need to install it.
38:20
Speaker A
We need to download first and install this software in your Windows operating system and then you can use it. So this is how we need to use PyCharm IDE.
38:30
Speaker A
Okay? This is another method. And the last method we have is method 7 by using Eclipse IDE. Eclipse is also IDE but most of the time we use Eclipse for Java but we can still use Eclipse for Python. So this is for Eclipse.
38:47
Speaker A
You can use Eclipse IDE. Okay? But we need to install one plugin for Eclipse.
38:54
Speaker A
Now I'll show you how we can do that. in eclipse also we can do that okay now let me just share small screen here so when you open your eclipse tool or eclipse application go to your help go to eclipse marketplace and here
39:08
Speaker A
you will search for pydev okay so this is a add-on or plugin we need to install on your eclipse if you want to write your if you want to work with the java project if you want to work with the python projects in
39:21
Speaker A
eclipse so once we have installed this one so pydev and just go to help marketplace and search for PyDev and it will give you one plugin here and then click on install button and it will be installed it will take a few seconds
39:35
Speaker A
and then finally install so once we have installed this okay and now we can open your eclipse now this is my eclipse I need to create a new project Python project so here already created here you see here this is my Python project
39:50
Speaker A
So under this project, there are some Python libraries by default it is displaying. And here I can create a new Python file which contains some code. So here, click on your Python project in your Eclipse and then go to new and here you
40:06
Speaker A
need to select a file. Okay. And what file we need to select here, what file we need to create, not a Java related file, we need to give the .py extension. And there is also one more way, just I click here, new here,
40:18
Speaker A
go to other. Okay, go to other and here you can see the PyDev. So inside the PyDev, you can just select your PyDev and module. So there is an option, right? So here you can just select this one. Okay, then click on the
40:34
Speaker A
next and it will create a new project actually. So instead of this, I will just create a new file. And here under, okay, just give some name here. So here, let's say test.
40:51
Speaker A
you tested dot a P Y okay now patient now it's created new Python 5 test dot P Y now here you can write the same code again so the right let's say okay so Eclipse Python okay so this is amazing and all with this I will also print
41:12
Speaker A
a few messages and here I'll come to Eclipse Python world and welcome to or I can just say this is Python run Eclipse okay now we have written some code here and now let's run this so right click here you can just run as Python
41:38
Speaker A
run so this is the option we have to use click on Python run now it will give you output in your console.winter and similarly I can write some code here let's say x is equal to 100 and y is equal to 200 and
41:51
Speaker A
now we will add these two numbers and print x plus y and then execute this code run as python run okay now okay so we have missed these brackets so we need to these are mandatory things so let me run this code now don't paste any spaces save this
42:13
Speaker A
again and then run the code run as python run so now we will get an exact output So this is the last way, the seventh way. So by using Eclipse ID, but here we need to install PyDev.
42:31
Speaker A
So we need to install a PyDev plugin. Plugin for Eclipse. And then we can create all our Python projects and Python files and then we can execute. Okay, so these are the seven ways We have to run our Python code through command line interfaces, by using online compilers, by using UI
42:53
Speaker A
editors like PyCharm and Eclipse. So that's all for this video. So let me just finish this. So please subscribe my channel to get more updates. So thank you all.
43:39
Speaker A
Hello everyone. Welcome you all. This is Bhavan. So in this video, I'm going to explain about the Python variables and Python data types and how we can do concatenation in Python. So let's get started. So a variable is
43:54
Speaker A
nothing but a reserved memory location to store values and variables are used to store the data and memory allocated when the values are stored into the variable and every variable must have some For example here if I say a variable called a
44:12
Speaker A
we need to store some value like this site What that what does that mean is here a is a variable? Is a variable and 10 is a value so as soon as I have I said some value to this variable there will be
44:24
Speaker A
some memory location will be created and this value go and store here and this location will be identified with this variable right so that is a variable now let us see how we can many ways we can assign these variables and how
44:40
Speaker A
we can how many ways we can define the variables and how many ways we can assign the values and all we'll see now let's go open pycharm so this is my pycharm so here i will just create a new python file so
44:54
Speaker A
here i will name it as a variables variables and click on okay now it gives the editor so let's see here how we can create a variables so first let us see a is equal to let's say 100 So let's say
45:08
Speaker A
10. So here if you go to Java or C++, when I create a variable, we must specify the data type. So that means we need to before itself, we need to tell what kind of value we are going to store in that
45:21
Speaker A
particular variable. But in Python, we don't need to specify any specific data type. So here, as soon as we have a sense on value into a variable, so that will be considered as an integer. Suppose if I say a number here, that will
45:34
Speaker A
become considered as a number. And similarly if I say one more variable, let's say here B is equal to okay, so let's try 10.5 So this will automatically consider as a float or a decimal number Okay, both are numbers but here
45:51
Speaker A
also we don't need to specify any data type So this concept is called as a dynamically typed so Python will support dynamically typed values means so whenever we assign a value to this variable automatically the data type will be decided so we
46:06
Speaker A
don't need to specify the data type explicitly in python right and similarly i will also define uh one more variable let us say here name so here i will write uh name here so strings can be included either in double quotes or in
46:22
Speaker A
the single course so in python but in java we cannot store the strings in a single course so there we can just store in the characters but here within the single course or double quotes we can use to store the strings.
46:37
Speaker A
This is right. And also we can store like this. Suppose let's say name one is equal to in a single quote also we can write a name like this.
46:46
Speaker A
Okay, this is also right. This is also a right notation in Python. So based upon the data we provided here that that variable automatically consider whether it's a number type, whether it is a string type and also we have also Boolean type.
47:02
Speaker A
So let me create one more variable. Let's say B or B already there something.
47:06
Speaker A
Let's say X is equal to I have two here. So true means there is a Boolean type. So X will be considered as a Boolean type. So this is called as a dynamically typed values. So this feature is available in Python. So based
47:20
Speaker A
on the value, it will automatically decide what kind of a variable it is. Okay.
47:26
Speaker A
Now I have assigned, I have created few variables and also have assigned some values to those. Now I will paint those values. So if I want to paint these values, I have to use a print command here in Python. We have a print
47:38
Speaker A
command and Python 3 versions. We have to put the parentheses. This is mandatory stuff, but in Python 2 versions, we don't need to put the parentheses. Okay, so here I will print the value of a and Similarly, I will also print the value
47:53
Speaker A
of B and also other values. Now here I'll print the B and here I'll just say name and and here I will print name one and I will print one more here x okay now let's run this so now you will get exact values now we can see a value is 10
48:13
Speaker A
then b value is 10.5 name is Pawan name one is Kumar and the last one is true right so this is how we can just declare the variables with some values and also we can just bring those values okay now In Python,
48:28
Speaker A
we can just define the variables and assign the values in different ways. Now I'll tell you a different. So for example, here I have created multiple variables with multiple values, right? But suppose I want to create all of them in
48:44
Speaker A
single line. So instead of writing this multiple lines of code, I can just write all the variables and all the values in single line. Now how we can do that? Let me show you here. So here I have, let's say, A, B, C.
48:57
Speaker A
AB and a name right so I can just directly say here a is equal to or a comma right and B comma C. So let's say name so here a B and the name and taking three different variables a comma B comma name equal to just we can specify the all the
49:18
Speaker A
values by separating comma now in the a I will just store hundred the a will store hundred comma In the B I will store let's say decimal number let's say 10.5 Now in the name I will store some name
49:34
Speaker A
now we can observe here So what I have done here is a comma B comma name these are the three different variables and Followed by three different values. So now here hundred will be Just a moment Right. So hundred will be assigned to
49:48
Speaker A
the a and 10.5 will assign to the B and power one is assigned to the name and Okay, so in Python it is possible. So if you have the different values for each variable we can assign like this now we can directly print
50:03
Speaker A
those values. Let's say print and we can directly specify a comma b comma c now all the values will print one after another now this particular statement Okay, so here I'm just writing some comment here So I will write some comment
50:21
Speaker A
here. So this statement is assign 100 to a right and 10.5 so 10.5 to b and Per one so here I have given per one right so here the per one is a keyword string and this will assign to the name assigned to the name variable right and here
50:42
Speaker A
we have done multiple values to multiple variables so multiple values to multiple variables now I have printed a comma B comma C now let's run this code and So for now, let it be just I'm running this code. It is giving some error
50:57
Speaker A
here. So what I can do is I need to just remove the about code not see here. It is actually named right now. Let's run this code. Right now we can see the output. So here a 100 B 10.5 and the name
51:13
Speaker A
is equal to power one. I have a say now I have printed all the values side by saying so 100 10.5 and so three have been printed.
51:22
Speaker A
So instead of creating multiple variables, I can just write all the variables and including the values with single line Okay For example So I have a same value for all the variables. Let us say I have a same way same
51:37
Speaker A
value for all the variables in that case how we can do that So I have a same values for all the variables how we can do that so we can do like this a comma 8 B comma C a comma B comma C
51:50
Speaker A
a If I follow the above notation, we can just write like this, right? So 10, 20, if it is a string or 10, or 10, and 10.
52:02
Speaker A
So observe this. I have assigned the same value for all the variables. So A is 10, B is 10, and C is also 10. And this is also right notation. Suppose if I print here, print A, B, C, it will just
52:16
Speaker A
again print 10, 10, 10. So when I run this, it will give you 10, 10, 10. This is a right notation, but here we can also still reduce this code. So instead of this, what we can do is I will just write one
52:28
Speaker A
more. I'll just comment this. You can say A is equal to B is equal to C is equal to 10. So this is how we can do that. So we have multiple values of variables. We can just follow these notations, multiple variable names
52:43
Speaker A
and multiple values. And if you have same value for all the variables, Then you can just say variables a equal to b equal to c equal to and finally specify the value The same value will be assigned to the a b as well
52:56
Speaker A
as c now when I run this code It will give you again same thing Okay, so this is how we need to do now I'll show you one more thing here Let me just put some line here Right so here I have
53:14
Speaker A
two variables. Let's say x is equal to 1 and and y is equal to 2. Right? So now what I want to do is I want to swap these two numbers. I want to swap these two numbers. I want to make a y.
53:27
Speaker A
I want to store y value into x and I want to store x value into y. So how we can do this? It's very simple in Python. So with single line of code, we can do that. Let me show you. So just say
53:39
Speaker A
here y comma x is equal to x comma y. Okay, simple. See now what happens is first y comma x these two are the variables equal to x comma y so first x will be stored into the y and then
53:54
Speaker A
y will be stored into the x So these are how we need to assign the values. So here what happens is So assign y value to the x so y value to the x and x value to the
54:07
Speaker A
y So here x value assigned to the y and y value will be assigned to the x and So after that we can just print those values by using print command print x comma y. Now what is x is here? y
54:22
Speaker A
is 2. But it will print 2 comma 1 after exchanging. Now run the code. Now we can see you will see 2 comma 1 output. Okay. So we can also assign the values like this. So in Python, so these many ways we
54:38
Speaker A
can define the variables and we can assign the values to those variables. Right. So now let's move on to the next one. Data types. So normally in the Python, there are multiple data types. We have like a number type, string type, list
54:54
Speaker A
type, tuple, dictionary and boolean type. But we don't need to specify any specific data types. So based on the data that will be treated as whether that variable is belongs to number or string or list, tuple, dictionary or boolean. Okay, now in this
55:09
Speaker A
video, I'm just talking about numbers and string and boolean and rest of them we will talk about in the next videos. Now, let us start with this data types.
55:18
Speaker A
Okay. Now, here I will create one more file, Python file. Let me close this and let me clear this. So in the Python, I'm going to create one more Python file and here I will name it as a
55:34
Speaker A
data types. Let's see what are the different types we can have in Python So here I will just create two different variables. Let's say X is equal to 100 So as I said before as soon as I say X is equal to 100
55:49
Speaker A
so X will be treated as a Integer variable. So in the number itself, we have two ways. Okay, one is a integer the other one is fold in Python and I said number is a data type so we have an int and also
56:03
Speaker A
we have a float so int means Without decimal number and float means with the decimal number is a fraction number. Okay, and Whenever suppose if I say without decimal number that will be treated as int which is also again number type and when
56:17
Speaker A
you say suppose hundred or something here This is a number or decimal number. So which will treat us a float again This is comes under the number now here.
56:26
Speaker A
I will just say x is equal to hundred what kind of type it is it is an int type This is a int type of variable Similarly, I will also create one more. Let's say X is equal to Y is equal to and
56:39
Speaker A
there's a 10.5 This is a decimal number, right? It will treat it as a float type. It will treat it as a float type and Similarly, I will also create some more different type of variable. Let's say Yes, so yes is a string
56:54
Speaker A
so here if I put anything in the double quotes that will be treated as a string now when I say welcome, so yes will be considered as a string type right so this is a string or character now
57:08
Speaker A
I Will create one more variable for boolean. Let's say B is equal to and I will put true so in the boolean it will allow us either true or false and TA for uppercase letters now this will be treated as
57:22
Speaker A
a Boolean this will be treated as a Boolean type now I have created multiple variables with different type of data and here we haven't specified any data type because Python we don't require So it will dynamically type means it will automatically consider
57:38
Speaker A
the based on the value. It will automatically consider the what kind of data type it is. So here X is the Indy type. Y is a flow type. Yes is again string type. B is a Boolean type. But how we will know whether
57:50
Speaker A
this is considered as an integer float or string or Boolean type. How we will know here. So in Python, we have a method called as a we have function called as a type. So by using that function, We can easily find out what
58:03
Speaker A
kind of data type it is. So let me write here. So let me write a SMS column to know the type of variable. Okay. We have to use a method called as a type method. So let me know. Let
58:20
Speaker A
me just use it here to know the type of variable. So what kind of variable it is. If you want to know, I need to use a type function in Python. So simply just type print print type of X. Okay, print type of X. So X is a variable which contains
58:42
Speaker A
some integer values. So type of X means it will return what kind of data type it is. Let me just run this form. Now here you can see class is int. So that means this variable is belongs to int type because we have
58:57
Speaker A
stored a number without decimal. Now similarly, I can also write one more command. So let's say here. This is why so when I run this again, so this will give you class type is float. So that means it contains a decimal number
59:13
Speaker A
and also I will write same thing for Yes string and also for boolean. So let's say be here now Let's run this code and it will give you exactly the same thing. So the first variable is int second is a float
59:27
Speaker A
and third one is string so it will be shown as str means it is a string and the last one is a boolean so that will representing as a bool so these are actually python data types so based upon the data we have
59:41
Speaker A
stored in those variables it will treat it that particular data type so for example 100 is a number so it will treat it as an integer 10.5 is a number and it will treat it as a float because it is a decimal number
59:54
Speaker A
and welcome is a sequence of characters them in double quotes will be treated as a string str and true is a boolean value we can store either true or false now we can type all the we can know all the types of these
60:09
Speaker A
variables okay so this is about data types in python so most of the times we use number or string or boolean so these are the data types you have in Python so either data type like least a tuple
60:25
Speaker A
dictionary will discuss in the coming videos now Let us see about concatenation in Python. So how we can do the concatenation? So just now we have discussed about different data types, right? So concatenation means a joining Okay, let us see how we
60:41
Speaker A
can work with this concatenation. Let me just open a Python so again, I will create a new Python file here under my project go to the new and Python file so here I will name it as a concatenation Concatenation and click on
60:58
Speaker A
ok button Now here I will just write a small piece of code Let us see now. So when I say here observe this careful. So print 10 plus 10 so plus is a concatenation operator Okay, so when I say 10 plus
61:15
Speaker A
10 so 10 is a number 10 is also number both are same exact same time and So it is a valid statement. So if I run this it will give you 20. So this is it valid. This is valid. Now when I say
61:31
Speaker A
a print print, let's say 10.5 plus 10.5 10.5 plus 10.5. So is it valid? Yes, it is valid because first one is number.
61:43
Speaker A
Second one is number and both also decimal numbers. So when I run this code, it will give you 10.5 plus 10.5 will give you 21.0. this is also valid statement so here we need to understand we can concatenate to
62:00
Speaker A
same format suppose two integers we can contact two floors we can contact two strings we can contact or two booleans we can contact but other types we cannot contact okay let's see what our valid things and what are invalid things so here I
62:15
Speaker A
have just added concatenated two decimal numbers so this is a valid Now similarly, I will concatenate two strings. Let us see here print print the first thing I will give a welcome and Concatenated plus and here I will just write
62:33
Speaker A
a Python. So now I have created two strings. I have concatenated two strings. Now when I run this code It will give you welcome Python. So that means it is also valid. It is able to concatenate those two strings Right Now let
62:50
Speaker A
me just add this now see this This is a scenario. So printer. I will just say 10 comma 10.5. So is it valid or not? So 10 is a number 10.5 is also number but 10 is an integer int type and 10.5 is
63:07
Speaker A
a flow type So let's see what this will give either it is valid or invalid. Let's see now run this code again So what it is giving exactly this printed the same value. Sorry, it is not comma have to do concatenation right so
63:22
Speaker A
now run this code it will give you 20.5 so what it is treating here is a 10 is a in the 10.5 is a float but still both are really belongs to number only right so that's the reason it is
63:37
Speaker A
able to add these two numbers okay so if i use a plus operator between numbers that will be doing other midi cooperation it will add those those two numbers and it will perform the output of those two numbers and if I use the
63:52
Speaker A
plus operator between the two strings it will just concatenate okay now this statement is also valid because both are belongs to number and now I will write one more statement let's see here print print and this time I will use a boolean so let's say true okay true plus
64:15
Speaker A
five so is it valid statement or not let's see So true true means in Python it will be considered as a one and false means it will be considered as a zero. Right. So when I run this code. Okay. Now it
64:31
Speaker A
will give you six. So output of this statement is six. So how it is calculated. So as I said before true is a boolean and the value of true is one. So one plus five. So it returns six. So this is again valid
64:46
Speaker A
statement. This is again valid statement. similarly if I write something called print print okay a true I'm plus to see this true plus two so can we have two boolean values let's see so two true means one and two
65:04
Speaker A
means one so one plus one what is output we will get let us see so when I run this code you will get two as an output because true means one and again one more room is one so one plus one it will
65:19
Speaker A
returns two So this is again valid statement. Okay. So this is again valid statement. Now I will write one more thing. Let's say print. So false. I will just now say false plus let's say 10. False plus 10.
65:37
Speaker A
So what this will return now? False means 0. 0 plus 1. Again 10. 0 plus 10. 0. 0 plus 10. only right so it will print return it will return 10 and it is also still valid now on this code
65:53
Speaker A
now we can see 10 here okay so these are all statements are valid now come to the invalid part so these are all comes under the valid statement right now what are the invalid statements let's see here I will just join
66:09
Speaker A
one integer and the other one is a string see this these are all two different types N is an integer or number type and welcome is a string type, right? So when I run this code, this will give you an error. See now
66:25
Speaker A
what is an error it is giving? Just let me just read this error. So it will give you not value. So type error, this is a more important. So type error it is giving. It's giving type error. So why it is giving type error because It cannot join two different
66:48
Speaker A
types. So the Python cannot join two different types. So 10 is a number. Welcome is a string. So both are different types. So that's the reason it is not able to join. So what is an error we are getting here? Type error. So
67:02
Speaker A
type error is the first error we are getting in the Python. So when we will get the type error, if you concatenate two different values, two different type values, and then we will see type error. So this is again invalid
67:16
Speaker A
statement. This is a not valid statement. It will comment and I will write one more statement. Let's see this print print and 10.5. This is a decimal number and again, I will concatenate with some string. So this is also invalid because
67:33
Speaker A
one is a number and the other one is string. So this will also give you the same error. So type error. This will also give you type error because both the types are completely different. Now I will also write one more
67:48
Speaker A
statement. Let's say print right so this time I will use boolean true Right. So here I will just say string Okay, now you can see here true means one true means one and Welcome is a string. So both are different type right?
68:06
Speaker A
So this will also give you the same same kind of error. Let me run this for run concatenation and Now you will see the same error called type error unsupported operation types. Okay, so these are all invalid statements. So
68:22
Speaker A
concatenation is possible in Python only within the same type of data. Okay, so that's the point we need to understand. So here I have listed out what are valid things and what are all invalid things. So here both are numbers. So
68:37
Speaker A
it is valid here again both are numbers. It is also valid and here both are strings. So it is also valid. Here one is integer other one is float, but still both are related to the same number and this is also valid Now
68:51
Speaker A
in these three cases true is considered as one and false will be considered as a zero So 1 plus 5 6 it will return 6. This is also true and 10 plus false So false means 0 10 plus 0 it returns 10 So
69:05
Speaker A
this is also true and 2 plus true. So true means 1 here true means 1 1 plus 1 2 will return. So this is also valid statement And these are invalid state. So this is a number. This is a string. So it is
69:18
Speaker A
throwing not valid error and 10.5 and string value. So this is decimal number and this is string. Again, this is invalid. And the last one true and welcome. So true means one. So welcome is a string type. So we cannot concatenate those two.
69:32
Speaker A
So this will also throw not valid and type. So this is all about concatenation in Python. Okay, so that's all for this video. So thank you all please subscribe my channel to get more updates on this. Thank you all Hello everyone,
69:50
Speaker A
welcome you all this is the one so in this video I'm going to show you how to swap Python variables and how we can do really declaration of variables and then how we can delete variables. Okay, now let's get started. So I'm going
70:05
Speaker A
to show you this is our PyCharm. So here Let's create a new Python file. So I will just give naming as a swapping and click on OK button. So now I have created one file. So now here I'm going to show you how we can do the swapping part. Okay, so here,
70:30
Speaker A
we just write a comment called swapping. So in Python swapping is very simple. Let's say here I have taken a variable called X is equal to 10, right? Let's say y is equal to 5 so two variables have defined with the two numbers
70:44
Speaker A
and if you want to swap swapping means I need to exchange this value So X should become 5 and Y should become staying now simply we can say like X comma Y right is equal to and Y comma X Simple so what happened
70:59
Speaker A
now is Y value will be stored into the X and X value will be stored into the Y so once it is swapping is done we can just bring those values and write print command so here I can just say
71:14
Speaker A
I'll put some message here after swapping values are okay now close this quotation and comma print all the values X comma Y now if you want to print before swapping you can just write in the same statement here before swapping before swapping the values are X
71:34
Speaker A
comma Y so let's see how it will print now run this test Now we can see before swapping the values are 10, 5 and after swapping the values are 5, 10. So this is a statement we have to use. So Y value will
71:48
Speaker A
be assigned to the X and X value will be assigned to the Y. So this is a simple swapping of Python variables. Now I'll show you how to redeclare the variables. How to redeclare the variables. Now let me close this. I'll create another Python file. So here I'll name it as
72:10
Speaker A
a redeclaration. Okay. So here normally in Java or other programming languages, if I declare a variable, so again, we cannot redeclare the same variable multiple times, right? But in Python, we can just redeclare this variable. So let's see how we can do that. So let's say A is equal
72:29
Speaker A
to, I'll just say 100, right? Or I'll say A is equal to 10. Now here, I will just print the value of A. Let's say A here. Okay, now this will print a value of A. Now after printing this value, I will make
72:46
Speaker A
A value is equal to 100. So that means I have changed the value. I have redeclared this value. And now again, I will print the same way. So print A. Now let's see the output. So first time it gives a 10 here
73:00
Speaker A
and the second time it gives a 100. So that means we are able to redeclare this value. So we can just We declare this value any number of times, but in other programming languages, we cannot redeclar this value. So only one time you
73:14
Speaker A
have declared we can just change these values, but we cannot redeclar this one. Okay, but in Python, we can just redeclar the values multiple times. So that is all about redeclaration of a variable. So the next thing is a deletion of the variable.
73:29
Speaker A
Let me just create one more file new Python file. So delete it. deletion or deleting variables Deleting variables Now in this example, I'll show you how to delete the variable So for example here and I say a is equal to 100 a is equal to 10 So
73:49
Speaker A
it will create a separate memory location, right which contains a 10 Now here if I print this value, let's say print of a now this will exactly print the value of a because this is already created which contains some value and Now what
74:04
Speaker A
I will do is I will just remove that variable by using Delta so then Specify the variable name. So this one this statement will delete that way. So this will deletes the variable deletes a variable So once it is deletes
74:21
Speaker A
that variable again, I try to print the value of a So what this will bring now so this should give the error why because here we have already deleted this variable and But still we are trying to print the value of a right
74:36
Speaker A
so first time it will print the value of a But second time it is deleted here and then Here we are still trying to print the value of a so it will throw an error. Let's run this Now we can see here the
74:48
Speaker A
first value of a is printed as a 10 But after that I have just deleted this variable and still I'm trying to pitch that value of a so whatever it is giving so it's giving name error so name a is not defined and
75:04
Speaker A
So this is an error we are getting here. Name error. So when we are getting this name error, suppose if you have not declared something or it can be function or can be variable or it can be class whatever if you are not
75:15
Speaker A
declared, but still we are trying to use it. So in those cases you will get name error. So here a is a variable which is already deleted, but still I'm trying to get that value from K so that it is giving a name
75:28
Speaker A
error. So this is how we need to delete the So we have seen how to swapping variables how to redeclaring variables how to delete vehicles. So this is about swapping a redeclaring and deleting So there's all for this video. So thank you all.
75:44
Speaker A
Please Subscribe my channel to get more updates. Thank you
Topics:PythonPython tutorialPython featuresPython historyPython applicationsPython vs JavaPython programmingPython companiesPython installationSDET QA

Frequently Asked Questions

What makes Python a beginner-friendly programming language?

Python is beginner-friendly because it uses simple, English-like syntax, making it easy to learn and write code quickly without complex structures.

How does Python differ from compiled languages like Java or C++?

Python is an interpreted language, meaning it executes code line-by-line and throws errors immediately, whereas compiled languages execute after compiling all code at once.

Which major companies use Python and for what purposes?

Top companies like YouTube, Facebook, Google, IBM, and NASA use Python for web development, data analysis, automation testing, and AI applications.

Get More with the Söz AI App

Transcribe recordings, audio files, and YouTube videos — with AI summaries, speaker detection, and unlimited transcriptions.

Or transcribe another YouTube video here →