LITERALS ( NUMBERS & STRINGS ) - PYTHON PROGRAMMING

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello friends welcome back to our channel so in the previous session we have started the Python programming so in that we have seen the introduction and the features basic features and applications of Python and then we have seen how to download and install the Python software so it is a free software and it is a platform independent so that it can be installed in any environment and also it is an interpreter so after writing the program we need not compile the program directly we can execute the program so by default after writing the code the code will be directly converted into the bytecode so that we can directly we can execute the program so in this session let us have a look on how to execute the program the procedure to execute the program and then we will move on to the literals later constants so fast how to execute a program so the very first step is we have to write the code that means we have to write the instructions so for writing the instructions we need to open the editor so here in the previous session we have installed one idea a week so you can find this in your system after installing the Python so open this idea v right so you will get a window with these symbols so then you can find file menu so open this file so open the new file open the new file and now after opening the new file write all the instructions right all the instructions right so the instructions are not email program right so program is a set of instruction so we have write instructions and then save the file with the file name with extinction don't pee bike and after selling the bike not directly to run the program from idea so for running the program we can directly press f8 all or directly you can find the option run so click on this one so that we can find the run program so click this run so that the Python will be I mean the program will be executed in the Python shell script right so this is the procedure to execute this any Python program so firstly I have to open the ideally open the new file write down the instructions and then save the file with the filename any file name so with the but the extension should be is it not py so in the C language the extension should be in a dot C here the extension should be in dot P Y and the Mastiff we have to run the program using the IDE that means directly we can creat by using yes fine so this is the procedure to execute the program now let us look over the littles all these are the basics of Python so little constants later are constants now here in this little constants we are going to focus on two things one is all numbers other one is strings so members can be integers floating point numbers you can say there's a fractional numbers and even complex numbers even a complex numbers so strings can be single character or group of characters right so these are the different letters we are going to discuss the numbers integers floating points and complex numbers now let us see one by one first we move on to the numbers so how many ways how many categories on how many ways of I mean different numbers we can use in this pattern so as we know the integers so this is awesome like three five seven hundred three three fifty and so on all these other integers so there will be no fractional part only very integral part next floating point numbers so floating point numbers consists of fractional part so fractional part like one point four five point six three point one four two and so so all these are the floating point members next coming to the complex numbers so here is my turn you can also use this complex numbers directly where C language we can't use these complex numbers in order to execute these complex numbers we have to use the structures concept to perform the operations on complex numbers but in Python directly we can use these complex numbers by using something right so complex numbers in terms of a plus IB like 5 plus 3i so all these are the complex numbers so here if we want to store a long integers that means with large values and so on the integers or large values so c-loc integers if you want to store or assign a value to the variable as a long integer we need to add a suffix yell Oh captain yeah so any number 1 2 3 4 5 6 7 8 9 4 5 so this number is very large number and it can be stored in long integer and this number is represented as a long integer if we add yell as a suffix to this number so in order to represent this long integers we have to suffix the L to the particular number so unless you add the suffix yet it will want they represented as a long integer right for every one condition this year must be surfaced it can be in a small case and in lowercase or uppercase but the suffix must be and so here we can have the three possibilities using these nimbus so for example as I have explained here if a is a variable a is equal to 5 is well vary Y is equal to five point four threes Valley Y is equal to five four three two seven eight nine four six L is valid and a is equal to 5 plus 4i is very right so this is the integer this is the float or fractional this is the wrong integer and this is the complex example right next so here in this Python programming there are three possible cases while performing the automatic operations on two numbers so first one automatic blower flow right automated water flow problem next add magic under flow problem next the boss of precision problem right so there are three possible problems we can get in this Python programming first of an automatic mobile flow problem that means if we are trying to multiply two large numbers might look like two long integers right long floating point integers floating point numbers that means in P so if you want to try to multiply two long floating point numbers obviously we can get the result as a year left which is called as infinity that means we will get the result there's a very long integer right so we're now in detail floating point so it's very long so that's why the Python will return the value as a yes that is infinity so this will happens only when the two large point large floating point numbers are used to multiply next under flow so here also so if pool this is this problem will comes in division right so here if the numerator sorry if the denominator is large then numerator if the denominator is larger than the numerator then it will results but item will result in to reserve it as a zero zero so for example one divided by some 10,000 so it will result as 0.0001 so this kind of result the Python will give zero right that is almost equal to zero so this is one problem that is automatic another flower problem this will occur when you perform the division operation in Python let loss of precision so here also this occurs when you perform the division operation the division operation so if the numerator is divided by denominator and the result is a never-ending then we'll call it as a loss of precision so if that for example sorry next minute for example if you perform 10 divided by 3 so what is the result so 3.33 and so on and so on right so there is never any so in this cases we will get the loss of precision here also the best example I can say so 1/3 1/3 right so 0.33 tricky and so on Hiram's so in this cases so in these cases we will get the problem that it is a loss of precision here this we call it as a procedure so after decimal point the values we call it as a procedure so there is no finite ending above these positions in such cases 10 divided by 3 so in such cases this problem will be erased so these are the three problems may occur in Python programming so by using this automatic operator operations so first one automatic water flow that will occur if we multiply two large floating point numbers so the result will be given as infinity INF and automatic under flow problem so this will occur when you perform the division operation so if the denominator is large then the numerator then automatically the Python program will result to 0 and precision problem so this will also occur when you perform the division operation so if there is more limited precision value so example 10 by 3 so this is also one type of problem these are the three major problems we can get in number system and also in this Python programming we can represent any number in a hexadecimal format or wrong octal moment so it will be allowed right next next one we'll move on to the second later on that is strings strings right so strings here will be used single quote double quote simply put so singing good is represented using this one double quotes are this one triple course are this so here in our Python programming the strings can be represented in a li 3 that means by using a secret code or normal code or triple more so these two are same simply contain double code are same so we can represent the string in this way all in this way there is no change among these two coming to this triple core we have to use this triple code in a multi-line string multi lines right so the things for at paragraph we can simply say that for a paragraph we can use this temple course that means if any string is represented in more than one line then that multi-line string can be use that is a triple boss so for example so if you had a string welcome to Python programming so this thing is in two lines so we need to use single quotes double bull we have to use this triple good because this is this thing appears in more than one line so triple quotes use them triple quotes right hope you understood these things now next and skip sequences escape sequences so if you want to print the text has what's your name simply by writing the print statement this won't give the cut output it will show the error because this simple had the single code symbol is mod cannot be represented in print banner game so for printing this single code we have to use some escape sequences right so in order to print the special symbols in the print I mean in the on the screen we have to use this escape sequences so on this recorder is a backslash constants in our C language right so in order to print the single quote we have to represent that as backslash single put backslash single port right so in order to represent the slash slash slash so this represents the single quote slash in order to print the slash in display screen slash slash slash double quote right / double quote / yes that is for new length that we know in the C language some new line /p is a tab space this also will know in the C language similarly slash move is they represent the or L value right so octave al u /e x is for XML Excel is small right right so you have to represent this one so just we have to rewrite this one so print what slash Samir court yes your name so this will print the correct one because the single court is represented by using the escape sequence slash single boat so these are the different escape sequences so we will use the pool in the programming the slash n n /t and other than this single quote slash double slash and all these things will frequently we will use these two escape sequences in our programming so this is for newline character that means printing in the new life and then this is what temp space right hope you understood this X escape sequences now let us move the rasping rasping well fasting means whatever you are writing on the plaintiff using this printf the same will be displayed on the screen so whatever the information you are writing in bring the same will be printed on the stream so it will not allow any escape sequences so you know for them we have to represent our imprint for printing the last thing right so if you represent our imprint the taste whatever you are waiting in the print that will be act exactly will be displayed on the screen so for example the same statement so this statement will print the output as this one right because he a single quote in order to print the single code we are writing slash single go so in the same plane I have word Phi - oh come on so I am representing F R that means Musti so I am so user or the programmer is insisting the interpreter to consider the complete text as elastic so the escape sequence is not be you know so here if you write the same what / single quote yes you will think the output will be the same what sash Civil Code yes your name so here the interpreter will not consider this as an escape sequence because here the programmer insisting the interpreter to breathe the masking so for this lastly we have to place our in the beginning of printer right this is all about the escape sequences now stay formatting still formative so string formatting means just alignments so elements can be left and moved right element second element right by the left arraignment right alignment and center alignment so this is represented as less than symbol you have to justify right greater than symbol for my justified and cap symbol you can observe this cap that place in 7c language we call it as an bitwise or operator X all right so this is a can this symbol represents the centre alignment let me explain with an example so if you want to print hello simply by writing print hello comma see inverted commas less than 30 this implies 30 characters that is total length is 30 characters and this implies are left left arrangement right sorry or left to testify so the text will be displayed on the right side yourself from the life I post so here the spaces will begin from here to here the total length is 30 and the text will be printed here right and similarly ring hello greater than 30 there is a white justify so the text will be on the left side so if this is a component of characters 30 the text will be printed on them it said so this is the left chip so justified this is permissible left justify survives - defiance so which we can see in our words in this world right justification so but using this justification the space will be considered right the space will be adjusted so that the complete text will be in a same alignment so here one more thing left the justification means there is not implies the text is printed on the left side the spaces will be justified right so you have to justify means the spaces will be justified on the left and the text will be printed on the right and my justified means the spaces will be justified on the right and the text will be displayed on the left next print hello get the D that is if the total length is this one that means 30 characters the cap NewsCenter so the spaces will be equally justified on the left side entrances after displaying the text right hope Universal this is not this is not arrangements of the text this is the elements of the spaces right so that's one we are specifying the total length of the string so here this statement implies the proper length of the string is 30 right total length is 30 and it is justified this one I mean the justification is on left side that means the complete spaces will be on the left side after displaying the text in here my justification this is not centered Center alignment so here the right right most places and most places are equal after displaying the text so likewise the text will be aligned in the center so hope you understood this a string formatting right so let us stop here so we have seen defend this to later constant that is the number constants and the string constants so in that numbers here in Python programming the the interpreter will accept the numbers integers of floating points and the complex numbers and in that three problems may erase while performing the automatic operations that is under flow or flow and loss of precision so under flow will appears sorry overflow will may be existed if the operation is on multiplication that means if you if you are trying to multiply two large floating point numbers then the possibility of this that war forebay occurs and coming to this and the flow if the Reiter is a large number than the numerator then that underflow may incur that was a division if you're performing the division and the loss of precision also may occur when you perform the division right if there is no finite steps to get the position value so example we will see and then we will move on to the strains then we have seen the sting can be represented by using the single quote double quote and the triple quotes so here a single character will be also considered resisting so there is no separate characters right so every character is also a string so the double quotes and the single force both are having the same meaning so we can use a single quotes or double quotes for representing the string and for the presenting this multi-line string we have to use the triple quotes and then we have seen the rough string so SP escape sequences so in order to print the special symbols on the display screen like a single quote double quote or a slash backslash and everything so and a newline character and the tab and finally we see in the string formatting this justification of spaces so left to justify it lab I justify and the Central District so once you execute this program so that you can clearly understood this so let us stop here you should really understood my videos like my videos share my videos with your friends and if you are having any doubts regarding this Python programming feel free to post your dogs in the comment section so that I will definitely try to clarify all your doubts so thanks for watching and don't forget to subscribe to our Channel thank you very much
Info
Channel: Sundeep Saradhi Kanthety
Views: 132,225
Rating: 4.9299212 out of 5
Keywords: SUNDEEP, SARADHI, KANTHETY, PYTHON, PROGRAMMING, HIGH-LEVEL, LANGUAGE, PORTABLE, FEATURES, APPLICATIONS, INSTALLATION, INTERPRETER, PYTHON SHELL, PYTHON SCRIPT, INTRODUCTION, BEGINNERS, GUI, GAMING, WEB DESIGNING, PYTHON 3.7.0, PLATFORM INDEPENDENT, CASE SENSITIVE, SIMPLE, PYTHON BASICS, literals, numbers, strings, overflow, underflow, precesion loss, string formatting, raw string, escape sequences, string alignment, multiline string, python idle
Id: n7FOE3etRvY
Channel Id: undefined
Length: 31min 51sec (1911 seconds)
Published: Sun Jul 22 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.