Skip to main content

Python


 




PYTHON LANGUAGE

    

Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together. Python's simple, easy to learn syntax emphasizes readability and therefore reduces the cost of program maintenance. Python supports modules and packages, which encourages program modularity and code reuse. The Python interpreter and the extensive standard library are available in source or binary form without charge for all major platforms, and can be freely distributed.

Often, programmers fall in love with Python because of the increased productivity it provides. Since there is no compilation step, the edit-test-debug cycle is incredibly fast. Debugging Python programs is easy: a bug or bad input will never cause a segmentation fault. Instead, when the interpreter discovers an error, it raises an exception. When the program doesn't catch the exception, the interpreter prints a stack trace. A source level debugger allows inspection of local and global variables, evaluation of arbitrary expressions, setting breakpoints,  stepping through the code a line at a time, and so on. The debugger is written in Python itself, testifying to Python's introspective power. On the other hand, often the quickest way to debug a program is to add a few print statements to the source: the fast edit-test-debug cycle makes this simple approach very effective.

Comments

Popular posts from this blog

Linear Search Using Functions Python

                                                            Problem:                         We need to search an element from an list. We have variety of methods to search an element from an array but the simple way of search is "Linear Search" method. We just need a loop traversing the array and search for match. We can see  two ways for achieving linear search in this post.  Method 1:                    Here we just directly give the values of array and value to search in default , the code follows. list1 =[ 2 , 3 , 1 , 4 , 5 ] key = 2 for i in range ( len ( list1 )):     if list1 [ i ]== key :         print ( "Number found" )  ...

Binary Search Using Functions in Python

Problem:                    To find an element from a python list using "Binary Search" method. This search is quite different from  Linear Search . There we used a loop to traverse and searched for element but here we first sort the list and compare the key value to the mid value of the list if it matches, we found the element or else we split the list into two one half consists of the elements lesser than the mid value and other half consists of the elements greater than the mid value, This process is repeated till we find a match. Code: def binarysearch ( a , k , start , end ):     mid = int (( start + end + 0.1 )/ 2 )     if a [ mid ]== k :         print ( "number found at position " , mid + 1 )     elif a [ mid ] > k :         binarysearch ( a , k , start , mid )     elif a [ mid ] < k :         binarysearch (...