PYTHON




 

PYTHON is an interpreted, interactive, object-oriented programming language.

- When a language is interpreted it means that it is processed at runtime by the interpreter. 
- Interactive means that we can actually sit at a python prompt and interact with the interpreter directly.
- Object-Oriented is a style or technique of programming that encapsulates code within objects.



Advantages and features of Python:
  • Readability
  • Fast to Code
  • Reusability
  • Portability
  • Object-Oriented Programming
  • Rich build in modules
  • Improved error checking
  • Flexible data structures
  • Reduces software developement time
  • Indentation instead of braces 
  • No variable declaration is required
  • Extensible










      Interactive:























      Hello world program (interactive):

      root@home-pc:~# python
      Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49)
      [GCC 4.3.2] on linux2
      Type "help", "copyright", "credits" or "license" for more information.

      >>> a = 10
      >>> b = 20
      >>> a+b
      30
      >>> firstname = 'VINOD'
      >>> lastname = 'S'
      >>>firstname + ' ' + lastname
      VINOD S
      >>>len(firstname)
      5
      >>>len(lastname)
      1

      Batch:




























      (Screenshot of a simple python program and its result)
      Aim: To print the square of numbers from 1 to 10

      No comments :

      Post a Comment