In order to write our first python program we need one text editor . we can also use IDLE , IDE ' s etc.
In this tutorial we are using Sublime Text Editor for writing our python program.

Save the file with .py extension . eg First.py

  • Executing the python program

    Open CMD and go to the place where we have saved our First.py file.
    Now use python filename.py command to execute our python script.

    Executing the python program
    Example)
    drag_handle
     
    #First python program
    print("Hello Python , This is my first python program")
    print("we have successfully installed python in our system and made our first python program")
    Output:
    Hello Python , This is my first python program
    we have successfully installed python in our system and made our first python program
  • Python Interactive Mode Programming

    Python interactive shell is used to test the code immediately and does not require to write and save code in file.
    Here we are using Python IDLE .

    • Press Window Key and Type

      Python-Interactive-Mode-Programming560-812250262.jpg
    • Now Python IDLE is open and we can write and see the output instantly.

      Python-Interactive-Mode-Programming560-1416692675.jpg

    Python code is simple and easy to run.

What next?

The next topic is Python Identifiers

Share this page