Easy learning with example program codes

Python Example

Writing python codes can be done in two ways:

  • Writing Python code in a text editor and saving it with a .py extension. These file can then be executed.
  • Writing Python code in a Python interactive shell. This method is useful for immediate testing of code with no stress of writing and saving the code in a file. This method is suitable only for testing purpose and for small codes.

Example 1: Printing Sum of two numbers in python using a text editor.


a = 2000
b = 4000
print a+b


Example 2: Printing Sum of two numbers in python using a Python interactive shell.

Industrial Training

We offers Placement Oriented Training on Java, Spring, JSF, Hibernate, PHP, AngularJS, Angular 4, PLSQL, Oracle BI Publisher etc. We also provides Online training, please mail us at


We also provides the Development services for Website Development , Java Development, PHP Development, Android App Development etc. You can contact us on

Copyright © 2019 CodesJava Protection Status SiteMap Reference: Java Wiki