 Actually we have been working with IIT Bombay, we all four have been working with, am I audible? We have been working with working under Phatak Sir and Avina Sir for the past one and a half years on IIT Bombay X project and actually for this python thing we have around one and a half hours python and gyro, so that is a bit less time for telling you everything about python and gyro. So, we would be giving you a glimpse of what exactly the basic data types and all ok. So, me and Anand would be telling you about python and these two guys would tell you about gyro. So, we will be looking about the history of the installation part, the naming conventions, the basic data types, sequences, tuples, lists, then the installation and all. So, basically python was invented in late 90s sorry the early 90s, it was invented in Netherlands by Gudo Van Gosam, basically the name python, do you know the, how the name python has been aroused? Yes, there was a famous British TV shows in 70s, it was named as fine service. So, it was the script was written by Monty Python and this guy wanted some mysterious name and a tacky name. So, he gave the name as python in this language. Python is an open source language, you all know the advantage of an open source language, you can do many things, the whole open source community can contribute to any open source project. Basically since a long time it has been considered a scripting language, but more python is not just a scripting language, it has using python you can do many lot of things right from developing a web project to anything, you can do many big data projects, you can do so many things using python. So, python basically is a interpreted object oriented and a functional language. So, the main advantage of functional languages you can divide the language or you can divide the code into multiple sections. So, your code becomes much easier. The different features of python language could be it is easy to learn mostly python has the English keywords in it. So, learning python and all it is all other things in python are bit easier because of it. It has a huge associated libraries with it. So, it is one of the most important features, you know scipy, you know these libraries, most of the scientific computation libraries could be used with python, many I mean information security stuff can be those libraries can be used with python. So, the scope of python has been increasing day by day. So, it has an interactive mode, it is portable, it is extendable, it can be connected to multiple databases, I mentioned about big data problem. So, the no SQL languages have been constantly or gradually been used by the huge data science community these days. So, these no SQL languages can also be used with python, you know mongo, you know you tell every any language any database my SQL those traditional structured databases as well as no SQL databases and GUI programming can also be done with python. So, I guess the basic what python is you might have understood what python is. So, now we will look about the installation part, if you consider unique systems any ubuntu or a linux machine or any mac os python is pre installed in any of these machines. So, you need not worry at all, if you want to install it on windows you just go to python.org and on the home page there is a windows installer. So, even in that case you just download the MSI packages you start the installation as any windows installation and that is not a issue in that case as well. So, python can also be used with can be used with different IDEs. So, the different IDEs for python are emack then you can you can use it with eclipse by pydev and you here you do not need to install anything because every in at IIT every machine is ubuntu. So, you need not install it here. So, rest assured. So, the python interpreter one of the important features python is its interpreter. So, basically is an interpreter and interpreter what is it? It is basically a right. So, it converts the high level language I mean you pass it through an interpreter right. So, any language could be implemented using I mean it can be compiled and run you can run it by compiling it or you can pass it through an interpreter both have got its own advantages and disadvantages right. So, we use a python interpreter here. So, in this case on a interpreter on your console you just type python and you can get into the interpreter or the console of python. Basically, whenever you type python it prompts with this symbol right 3. During an installation part whenever the python gets installed it gets embedded with the current version number. So, any machine can have multiple python versions whenever it gets installed in windows it gets installed in your C and the python folder I mean in that folder which is embedded with its current version. Whereas, on the ubuntu machine it goes into user bin and then the python version number. So, whenever you enter into a python console you just type your code there and if you want to exit from that console you type I mean you hit control keys. So, any python proof file have an dot py extension. So, whenever you want to call python using an interpreter you just type python and the file name dot py on the console and also if you want to make any python file see using this what you your program might get executed on the console. But if you want to make the file itself as an executable you can make it. So, what you need to do is you will have to include this line at the as a starting line of your file. If it is fact dot py include this line as a first line of your file then execute this command change mode of that particular file and then execute this makes the file as an executable. So, you can execute the file by using this command the file limits on the console basically they are the same location this line would be included in your python file. So, first line of the python file then you execute this command on a console this will make that file as an executable and then execute that file on the console. It is a path where python has been stored see if this you have installed python 2.7. So, in that case this would be python 2.7 here the path where python has been stored. So, the basic data types in python are integers and the strings basically integers you know what an integer is. So, in python the integers are immutable. So, what does an immutable object means is the value of a particular variable cannot be changed after it has been initialized and the integers can be of four types one is a normal int the second is long third is float sorry I have to find the fourth one other other basic data type is a string. So, for specifying any string you can use either double quotes or you can also use the single quotes in that for using a string and that is it if you want to use a single code within that string in that case can you see here a single code has been used in that string. So, that number of double quotes are included outside that particular string explain see I want a string named a say I want a string named a semicolon b. So, whenever you want to use any string see the string name is y you want to initialize it you can either use as a b or you can use it as a b double and if I want to use a string as a such string. So, in that case there would be an issue here right. So, the interpreter or the this might think that this is the only string it would not consider b in that case. So, what would you do is you will include a single quote here and the double quotes outside this would be for the whole thing you get it. So, in all other languages white spaces are not given that importance whereas, in python white spaces are very much important. So, why are they important is because of the indentation thing in python. So, in any language if you compare it with java or in java what happens is you use blocks right in see you use braces. So, whereas, in python you do not use braces I mean you do not use blocks and for those blocks you do not use braces here what happens is you give proper indentation and those white spaces here are very much important because of that comments in python starts with a hash if it is a single line comment if it is a multi line comment you use such thing I mean the double quotes or single quotes three times assignment in python. So, in any language like java I am talking only about java because you might have used java on a large scale in your colleges in java whenever you want to assign anything you append with its data type int y is equal to 10 int or float y is equal to 10 whereas, in python you need not use its data type again whenever you want to use any variable it need not be declared initially you can start using whenever you want it you create a name the first time it appears on the left side of an assignment expression and the assignment expression is equal to whereas, for comparison you use 2 equal to 6 also you can assign multiple names at the same time. So, you assign x and y the same value as 2 at the I mean at the same time x is assigned 2 and y is assigned 3 and also this makes mapping a bit easier and the error handling as well as the I mean the error handling is very beautiful in python whenever an error is raised it is properly mentioned what has what issue has exactly been occurred also whenever you want to whenever you access any variable which has not been assigned any value before. So, that gives you an issue. So, first assign some value to any variable and then use otherwise it might give you an error. So, any variable name you can give variable names as you want, but there are certain reserved words which you cannot assign or you cannot use in your code and those are and assert break class do you want to write it down or should we go to the next slide. So, there are certain naming conventions every language has got its convention and python it has not been recommended by the community, but it is better if you use its conventions naming conventions it is better if you avoid I L and O in your because what happens is many times if you declare any variable as I and if you switch to any other editor in that case you might get confused with one or L right. So, it is better you do not use such variables then for functions methods and attributes you used joined lowers that is if it is a function define it as. So, it is everything lower for a function method and an attribute if you want to declare any constants it is better you use everything in caps lock the class names also should be caps words the modules should be all lower case letters and for the attributes there should not be any underscores if you talk about modules the modules can consist the module names can consist of many words. So, those many words can be used with an underscore as well. So, if it is in turn by an attribute can have an underscore where as for an attribute you cannot give a you should not give a leading underscore the control flow statements or the loops here the basic loops while and for loop. So, whenever what basically a while loop you know that this while loop should be terminated with a semicolon here and then the whole so that is what I said this indentation matters a lot in python here in Java what you need to do is you need to give those braces whereas in python if you write this line this line a bit here this will give an error if you write it here in this line this statement would not be considered to be a part of this loop. So, there should be a proper indentation always same for the for statements this basically is a sequence. So, this for loop would iterate through every index of that sequence. Yeah python 3.19 any of you will be using python 4 right 2.7 right if it is a if you want to you can use range as well. So, if you have a range of values from 1 to 20 you can use range for I in range 1 to it should start from 1 itself. So, from 1 to 5 you would yes you can change that you just need to you can even increment it here right. You can you cannot use it here in the range you can or else what you can do is range 5 comma 1 or 2 that would increment it by 2 numbers 5 comma 2 ok. So, that would increment it in the range function then similarly for if statement we use if here we do not use else basically the condition should not be given in braces in an if statement and if ends with a semicolon then this whole statements are considered to be this if statement the else part here it is written as L if not as else if or else and you can also use pass break and continue statements if you are what it just passes to the next next if you are using it in a loop if you use a pass it moves the execution to the any statement after that loop yeah pass using a break you just move out of that whole loop right also you can use as it is a functional language so you can define it in that function as itself. So, functions basically are you know the role of a function so here if you want to define any function you have to define it using DEF keyword. So, the function name is given after the keyword def the function name and any arguments which you want to pass to that particular function this is I just haven't seen the examples pardon I haven't encountered it right ok so this would print a spaces fine basically the you can pass arguments to any function using keyword arguments. So, if you consider this particular function as parent and use different arguments to it if you do not pass any argument to this function this particular variable or any argument would have this as a default value and this these basically this is a this is not an optional argument to this particular function whereas, these should be considered as an optional arguments. So, here we are basically passing one compulsory argument whereas, three optional arguments. So, if you want to call this particular function how it is called as. So, you can call it as one positional argument this 1000 would be given to voltage then you can also give you you can give a one keyword argument the keyword should be mentioned there these are two keyword arguments these are this is an example of two keyword arguments basically any argument which has been given there any value here this should be considered a default value you can also replace it with whenever you call it. So, in that case you need to give the argument name there whenever you call it if you want to you can specify if you do not want to that is what we see if these are these can have default values. So, in that case we did mention the keyword I mean the argument as well as its value whenever we call it. So, what is it? So, that is what I am saying right you can give the argument name if you want to if you do not want it if it is a see that is a positional argument it would require give it if you write what exactly should you see this basically is a positional argument if you want to use it as a keyword argument then in that case you need to do that argument name keyword. So, the voltage can be written at the first place then it is a if you want to write it using the positional in the positional sequence you will need to write it at the first if you want to use it like here we have changed the position. So, it is a keyword argument in that case you need to write the keyword argument till now what differences we have observed in this slide says in java all variable names must be explicitly declared. So, it is like integer i integer any variable name whereas in python you need not declare the data type as well as those other things are not declared at all. If you talk about the container objects like vectors and arrow lists in java it cannot have basically in python if you talk about lists and dictionaries it can hold objects of any type whereas if you talk about vectors it cannot have primitive such as same thing and the code in java is the code in java is a bit lengthy if you talk about just a print statement in java it is a five line code whereas in python the code is just one line. So, the main advantage one of the advantages of python is it optimizes your code length and in turn it increases the efficiency and the other difference between java and python can be since both are object oriented languages both this can be an object oriented can be used as an object oriented language. If you in an any object oriented language you have many classes. So, in java if you want to write a class you will have if you want to write 15 classes you will have 15 files. Whereas in python if you want to write 15 classes you can write all the 15 classes in the single file itself. The next detailing about the sequences and other data types my friend Anand will be back in a moment.