First example program on console

First example program on console

Lesson Details:
September 17, 2020

Video Transcription: This is uh Anand Mahajan your instructor for this course of Python now see in this lecture I am going to show you a sample program that will be typed in notepad and will be executed on the console this video is brought to you by Appy Pie’s Academy, okay so suppose there is a variable is equal to hundred another variable is suppose B is equal to 1000 and after that I am going to write C is equal to a into B then I will write rent multiplication is plus str c so I have used STR because I might have explained it earlier also but let me explain it again multiplication is this is within double quotes and whatever is within double quotes that is considered at string and particularly this is the string constant right and this is string to a data type and here I'm using STR C rather if I try to use only C it is erroneous because plus is the concatenation symbol that joins both together and on both the sides the data type should remain the same so hence using STR what I am doing is using STR I am trying to change the data type of C to string okay so far so good so now I'm going to save this program file save as let me save in a folder called temp you can save it in the folder of your choice and I type it suppose the name is first dot py now listen carefully whatever name you want to give that is the there isn't any problem you can give ABC XYZ and or whatever name you want to give to your Python program but one thing is for sure the extension py is compulsory if you don't give this extension the program will be saved with the extension txt and that will be erroneous because that will not be interpreted by Python interpreter and your program will not run so P by extension is mandatory save okay there was already a program with the same name okay I have already over written it so it's a simple program variable a has been assigned the value hundred B has been assigned 1000 C is equal to a into B is going to give give a value 100,000 and subsequently I will print that value now let's go to the command prompt click on start CMD press Enter let me change the port here also right mouse button on the title bar properties [Music] ok so by typing CD slash temp what I am doing is I am switching to the directory where I have typed the program I am switching to the folder where I have typed the program the name of the program was temp name of the folder sorry name of the folder was temp so in the folder temp I had typed the program first dot p a p py so if you want to see it you can see it dir first got py yes the program is present now in order to execute this program I would write Python first dot py see the program has been executed multiplication is 100,000 the output has been generated now see what is Python as I have shown you in the previous lecture python is the application program with the full name Python dot DX C now I right now I am working in the directory temp how did it find the application program Python and executed this because we had set the path environment variable path and in an environment variable path we mentioned the whole path where python application file was present. 

loader
Course content