INPUT & OUTPUT STATEMENTS - 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 seen the various data types used in Python and the variables and identifiers and also we have seen the rules to be followed by creating a variable name and then how to assign the value to the variable so what is that declaration so why is the declaration part is not required in Python and then the multiple assignments in Python and how to write the comments in Python in this session let us have a look on the input and output statements used in Python power input so you can function with state output function honesty so in C language the input function is scanf function so here the scanf function is used to read the input from the user at the time of 110 right so here similar to the scanf here also will use a run function for reading the input from the user at the run time okay so that is the input function itself input function so this is used to read the data from the user at the time of execution that is the one time one time initialization can be done by using input function an output function as we have seen in the C language the printf statement is the output function here also this output function that we call it as a print print function so eliminated AF right so print function and input function so input is used to read the input print is used to display the output so similar to scan of in C similar to printf in see now here so MC language so as there is a declaration before using the variables so there are different data types and there are different type specifics so by using those types base pairs will be read the data and here there are no separate declaration part so by using this input statement always the user reads the string data it means so always whatever the input taken by the user will be in the form of sticks so as we know exchange have a group of characters so in our computer programming every thing in a keyboard will be treated as a character so which we have followed in the C language itself so alphabets A to Z upper case letters and lower case letters and a special symbols and also the numeric data 0 to 9 and in term space and every button and the keyboard will be considered as a character so obviously the string is a group of characters so here 55 can be a number or a character right so here if a is equal to 55 this will be treated as a number if a is equal to 55 that means if 55 is enclosed in double quotes that 55 will be considered as a character so 5 5 2 5 so we should not call it as a 50 point 5 5 next here in this Python programming the input function will always raise this string data so the input will be always stink so if you want to perform some addition or multiplication or some other medical operations so we need to convert this thing into particularly day today so that we call it as a time conversion right so here also there are different type conversions so there are different functions so it is very simple to convert this any from any data type to anything any data so that combustion is very simple in Python so there are all built-in functions right so always the input will be in a string so here so in the input what are the information we are writing in between the double quotes will be considered as a normal text so the same as a printf statement so text in drama codes we'll consider as normal text and this place display on the output screen right for example if you want to write input some a is equal to input and tell number J is equal to he is equal to input enter number so here the texture is returned in between two double ports so yet the one time if the user pressed some file as input Y is equal to five will be I mean if I will be assigned to a he had five easy right here five is treated as a string because the input function always takes the string as a input right so if the user enters some ABC this is also a string if user enters some 3.4 this is also a spring so it will treat it as a string so whatever the data the user enters at the runtime that will be considered as it string right so and whatever the text we are writing in between the double course in the input function will be directly displayed on the output stream so in the screen it will be displayed as in turn number and if the user prints fine if I will present to you if user print see ABC the ABC will be pretty sent to you if you press 3.4 3.4 will be sent again but all these they are a string format right so in order to change this format we have to use a type conversion so we will see the type conversion in the next video right so whatever it may be so always the input function will take the string format next print here also whatever the text display text in double quotes or single quotes anything will be considered as a normal text and display on keyboard monitor output screen right so if you want to I mean for example C 3 hello automatically also display screen hello will be printed just like about printer so here remember so the line should not end with semicolon right we need not mention semicolon at the end of the line next if you want to print the value of a variable right so if you print the value of a variable on the output screen in C language we will use sometimes type space PS so if you use a percentage D in printf in the place of percentage D the value will be printed the individual value will be printed if you use a percentage F in the printf so the float value will be printed that at the place of percentage of but here if you want to print a value of a variable we need to write that variable in I mean after the double quotes after ending the double quotes right so whatever the text we are writing in the double quotes will be taken as a lot more text and whatever the variables are I mean whatever the names were writing outside the double quotes that will be cultured as a variable a simple thing so the names writing after the double quotes will be considered as a variables see for example yeah is equal to five right if you want to print a file simply we can write print yay so this will print five on the screen if you write print yay this will print yay right so if it is in so here a is equal to five so direct assignment and five is a new number so yeah we'll be off integer data right so five is a number that is also an integer so file can be assigned to here here find the adjacent to a so yeah is a variable with integer data type now if a is equal to five point four here five point four is a number and that is also a floating number so a is having a float datatype and if you pray this if you want to print this here they have to print here you have to like and second example let us take text some name is equal to Python so this is also a variable initialization so the variable name is equal to Python so here python is a group of characters so that will be concerns a string so this will be considered as a character now if you want to print this thing thank you we can write print name directly we can get item as oh if you want to write it hello hello cross comma this mean so if it is this thing we have to use it plus to print the output so here we can get hello right if it is as thing we want to print in the display screen we have to write a plus so if this is the first example let us do second example a is equal to five right if you want to print the print a is equal to so that is what will be printed come back I have to write only a we should not write a plus B a so here the plus is usual only for concatenating the string necklace displaying the string on the screen that is only users per string tended to print the value of string edit right so in order to use the variable consists of a string then we have to use a class in order to display right so if you want to display in normal a number should write just a very minute so a is equal to comma Y so if this place a is equal to 5 hope you understood this place cleaned up I mean print function output function so while reading the programs we will see more number of options in this print function and they into function right so these are the just a basic input and output functions a basic formats of input and output functions basic syntax so there are different parameters we can use in print print function and we can use in the input function so all the type conversions and all the different formats used in print function that will be seen in the next video we will see in the next video hope you understood this one I said input function and output function input function is similar to scanner output function is similar to pre death so here input function is input output function is print input function always takes the string format data in distinct format and pre function always display the data on the screen so whatever the text to display in between the double course will be concerned as a normal text and it will be displayed as tis in the screen right here the text in the whole course will be considered as a normal text it will also displayed on the screen and the data which we are assigning to the variable will be conservative in right next here if you if you want to print the value of a variable we need to use use the variable outside the double quotes so if you want to display the value of a string variable we have to use a plus so if you write some text in between double course and if you are want to add some value of that particular variable if it is a character array that is a string we have to use this plus symbol and if you if you wear any sizes of a numerical data and if you want to print that numerical data along with the some text we can use a simple comma to print the output so here hello python should will be printed in this format hello so double course n comma class name right and print a print a is equal to in double quotes comma simple a so here we should not include less right hope you understood this is a printed input for charts so if you really like my videos like it and 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 notes and don't forget to subscribe to our Channel and thanks for watching thank you very much
Info
Channel: Sundeep Saradhi Kanthety
Views: 69,107
Rating: 4.9314146 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, input( ), output( ), I/O STATEMENTS, INPUT STATEMENT, OUTPUT STATEMENT, INT, FLOAT, STRING, COMPLEX, TUPLE, LIST, DICTIONARY, TYPE CONVERSION
Id: JBc8LLW5KLQ
Channel Id: undefined
Length: 17min 6sec (1026 seconds)
Published: Mon Jul 23 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.