CodesJava

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.

//pythonexample.py

a = 2000
b = 4000
print a+b

Output:

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

Sign Up/ Sign In
Ask a Question


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 hr@codesjava.com.

Development

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

Copyright © 2018 CodesJava DMCA.com Protection Status SiteMap Reference: Java Wiki