Python
Python
Python
MD.Rasheduzzaman ID:0910647044 MD. Mahabub Akram ID:0910
Introduction
Highly portable
Features
Productivity
Usability
Rapid prototyping
Web scripting Throw-way, ad hoc programming Steering scientific programming Extension language XML processing Database application
GUI application
A Glue language
Python is slower but development is so much faster Python can be used with Java: Jython
Python Basic
Variable name alone is an expression, so the result is printed Variables must be created before they can be used
>>>b Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> b NameError: name 'b' is not defined
String
1.May hold any data, including embedded NULLs 2.Declared using either single, double, or triple quotes
>>> s=Hi there
>>>s Hi there >>>s=Embedded quote >>>s Embedded qoute
Blocks
Looping
Functions
This defines a trivial function named foo that takes a single parameter bar The function object can be called:
>>>foo(3) 3
Class
The constructor has a special name __init__,while a destructor uses __del__ The self parameter is the instance Classes are instantiated using call syntax
>>>f=Foo() >>>f.getMember()
Modules
Thank You