{"id":3220,"date":"2023-10-20T11:40:34","date_gmt":"2023-10-20T06:10:34","guid":{"rendered":"https:\/\/python-programs.com\/?p=3220"},"modified":"2023-11-10T11:50:27","modified_gmt":"2023-11-10T06:20:27","slug":"python-programming-compound-statement-built-in-functions","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/","title":{"rendered":"Python Programming \u2013 Compound statement Built-in functions"},"content":{"rendered":"

In this Page, We are Providing Python Programming \u2013 Compound statement Built-in functions. Students can visit for more Detail and Explanation of Python Handwritten Notes<\/a>\u00a0Pdf.<\/p>\n

Python Programming \u2013 Compound statement Built-in functions<\/h2>\n

Built-in functions<\/strong><\/p>\n

Till now, the discussed functions need to be defined before using it in a program; such functions are called user-defined functions. Python has a number of functions that are always available. These are called built-in functions. They are listed here in alphabetical order.<\/p>\n

                   abs ( )                                  all ( )                                          any ( )\r\n                   basestring ( )                       bin ( )                                        bool ( )\r\n                   bytearray ( )                        callable ( )                                 chr ( )\r\n                   classmethod ( )                   cmp ( )                                       compile ( )\r\n                   complex ( )                          delattr ( )                                    diet ( )\r\n                   dir ( )                                   divmod ( )                                  enumerate ( )\r\n                  eval ( )                                  execfile ( )                                   file ( )\r\n                  filter ( )                                float ( )                                      format ( )\r\n                  frozenset ( )                        getattr ( )                                   globals ( )\r\n                  hasattr ( )                            hash ( )                                         help ( )\r\n                  hex ( )                                 id ( )                                            input ( )\r\n                  int ( )                                  isinstance ( )                             issubclass ( )\r\n                  iter ( )                                  len ( )                                         list ( )\r\n                  locals ( )                             long ( )                                         map ( )\r\n                  max ( )                               memoryview ( )                            min ( )\r\n                  next ( )                              object ( )                                        oct ( )\r\n                 open ( )                              ord ( )                                           pow ( )\r\n                 print ( )                            property ( )                                      range ( )\r\n                raw_input ( )                      reduce ( )                                     reload ( )\r\n                repr ( )                              reversed ( )                                   round ( )\r\n                set ( )                                setattr ( )                                        slice ( )\r\n               sorted ( )                           staticmethod ( )                              str ( )\r\n               sum ( )                               super ( )                                         tuple ( )\r\n               type ( )                               unichr ( )                                       Unicode ( )\r\n               vars ( )                              xrange ( )                                        zip ( )\r\n             import ( )                           apply ( )                                         buffer ( )\r\n              coerce ( )                          intern ( )<\/pre>\n

Some of the above built-in functions are discussed below:<\/p>\n

abs ( x )
\nReturn the absolute value of a number. The argument may be a plain or long integer or a floating-point number. If the argument is a complex number, its magnitude is returned.<\/p>\n

>>> abs ( - 34 )\r\n34 \r\n>>> abs ( 34 . 5 )\r\n34 . 5\r\n>>> abs ( -3 -4 j )\r\n5 . 0<\/pre>\n

all ( iterable )
\nReturn True, if all elements of the iterable are true (or if the iterable is empty).<\/p>\n

>>> all ( [ True , 10 ] )\r\nTrue\r\n>>> all ( [ True , 10 , 0 ] )\r\nFalse\r\n>>> all ( ( ) )\r\nTrue<\/pre>\n

any ( iterable )
\nReturn True, if any element of the iterable is true. If the iterable is empty, return False.<\/p>\n

>>> any ( [ 0 , 5 , -3 ] )\r\nTrue\r\n>>> any (  [0 , False  , -3 ] )\r\nTrue\r\n>>> any ( ( ) )\r\nFalse<\/pre>\n

bin ( x )
\nConvert an integer number to a binary string.<\/p>\n

>>> bin ( 8 )\r\n' 0b1000 '\r\n>>> bin ( 27 )\r\n' 0b11011 '\r\n>>> (27) . hit_length ( )\r\n5\r\n>>> bin ( -1327 )\r\n' -0b100101111 '\r\n>>> ( -1327 ) . bit_length ( )\r\n11<\/pre>\n

bool ( [ x ] )
\nConvert a value to a boolean. If x is false or omitted, this returns False; otherwise, it returns True. If no argument is given, this function returns False.<\/p>\n

>>> bool ( 5 )\r\nTrue \r\n>>> bool ( -5 )\r\nTrue\r\n>>> bool ( 0 )\r\nFalse \r\n>>> bool ( ' hi ' )\r\nTrue\r\n>>> bool ( )\r\nFalse \r\n>>> bool ( '' )\r\nFalse \r\n>>> bool ( None )\r\nFalse\r\n>>> bool ( ' \\ n ' ) \r\nTrue\r\n>>> bool ( [ 0 ] )\r\nTrue\r\n>>> bool ( ( None , ) ) \r\nTrue<\/pre>\n

chr ( i )
\nReturn a string of one character whose ASCII-8 code is the integer i. This is the inverse of ord ( ). The argument must be in the range [0,255]; ValueError will be raised if i is outside that range.<\/p>\n

>>> for i in range ( 33 , 95 ) : print i , ' =  ' , chr ( i )\r\n. . . \r\n33 = !\r\n34 = \"\r\n35 = #\r\n36 = $\r\n3 7 = %\r\n38 = &\r\n39 = '\r\n40 = (\r\n41 = )\r\n42 = *\r\n43 = +\r\n44 = ,\r\n45 = -\r\n46 = .\r\n47 = \/\r\n48 = 0 \r\n49 = 1\r\n50 = 2\r\n51 = 3\r\n52 = 4\r\n53 = 5 \r\n55 = 7\r\n56 = 8\r\n57 = 9\r\n58 = :\r\n59 = ;\r\n60 = < \r\n61 = = \r\n62 = >\r\n63 = ?\r\n64 = 0\r\n65 = A\r\n66 = B\r\n67 = C\r\n68 = D\r\n69 = E\r\n70 = F\r\n71 = G\r\n72 = H\r\n73 = I\r\n74 = J\r\n75 = K\r\n76 = L\r\n77 = M\r\n78 = N\r\n79 = O\r\n80 = P\r\n81 = Q\r\n82 = R\r\n83 = S\r\n84 = T\r\n85 = U\r\n86 = V\r\n87 = W\r\n88 = X\r\n89 = Y\r\n90 = Z\r\n91 = [\r\n92 = \\\r\n93 = ]\r\n94 = A<\/pre>\n

cmp ( x , y )
\nCompare the two objects x and y, and return an integer according to the outcome. The returned value is negative, if xc’y, zero, if x==y, and strictly positive, if x>y.<\/p>\n

>>> cmp ( 2 . 5 , 5 . 2 )\r\n-1 \r\n>>> cmp ( 5 . 2 , 5 . 2 )\r\n0 \r\n>>> cmp ( 5 . 2 , 2 . 5 ) \r\n1\r\n>>> cmp ( ' hi ' , ' hello \u2019 )\r\n1\r\n>>> cmp ( 'hello ' , ' hi ' )\r\n-1<\/pre>\n

complex ( [ real [ , imag ] ] )
\nCreate a complex number with the value real+imag* j, or convert a string or number to a complex number. If the first parameter is a string, it will be interpreted as a complex number and the function must be called without a second parameter. The second parameter can never be a string. Each argument may be any numeric type (including complex).<\/p>\n

If imag is omitted, it defaults to zero. If both arguments are omitted, the function returns 0 j. When converting from a string, the string must not contain whitespace around the central + or – operator. For example, complex ( ‘ 1 + 2 j ‘ ) is fine, but complex (‘1 + 2 j ‘ ) raises ValueError.<\/p>\n

>>> complex ( )\r\nOj\r\n>>> complex ( 2 . 51 )\r\n( 2 . 51+0 j )\r\n>>> complex ( 2 . 51 , 4 . 79 )\r\n( 2 . 51+4 . 79 j )\r\n>>> c1=4+5 j \r\n>>> c2=6+7 j\r\n>>> complex(c1,c2)                                    # Equals ( 4+5 j ) + ( 6+7 j ) j = 4+5 j+6 j - 7 \r\n( -3+11 j )\r\n>>> c= ' 7 '\r\n>>> complex (c)\r\n( 7+0 j )\r\n>>> c=' 7 + 4 j '\r\n>>> complex (c)\r\n( 7+4 j )\r\n>>> x=2+3 j \r\n>>> x . real\r\n2 . 0\r\n>>> x . imag\r\n3 . 0<\/pre>\n

delattr ( object , name )
\nThis is a relative of setattr ( ). The arguments are an object and a string. The string must be the name of one of the object’s attributes. The function deletes the named attribute, provided the object allows it.<\/p>\n

>>> class new__cls:\r\n. . .                   def ______init_______ ( self , x ) :\r\n. . .                   self. x=x\r\n. . . \r\n>>> tt=new__cls ( 10 )\r\n>>> tt . x\r\n10 \r\n>>> setattr ( tt ,' x ' , 20 )\r\n>>> tt . x \r\n20\r\n>>> setattr ( tt, ' y ' ' hello ' )\r\n>>> tt.y \r\n' hello '\r\n>>> delattr ( tt , ' x ' ) \r\n>>> tt . x \r\nTraceback ( most recent call last ) :\r\nFile \"<stdin>\", line 1 , in <module>\r\nAttributeError: new__cls instance has no attribute \u2019 x \u2019<\/pre>\n

divmod ( a , b )
\nTake two (non-complex) numbers as arguments and return a pair of numbers consisting of their quotient and remainder.<\/p>\n

>>> divmod ( 13 . 5 , 3 )\r\n( 4 . 0 , 1 . 5 )\r\n>>> divmod ( 13 , 3 )\r\n( 4 , 1 )<\/pre>\n

enumerate ( sequence , start=0 )
\nReturn an enumerate object. The sequence argument must be a sequence, an iterator, or some other object which supports iteration, while start is a count (default argument as 0).<\/p>\n

>>> seasons=[ ' Spring ' , ' Summer ' , ' Fall ' , ' Winter ' ]\r\n>>> list (enumerate ( seasons ) )\r\n[ ( 0 ,' Spring ' ) , ( 1 , ' Summer ' ) , ( 2 , ' Fall ' ) , ( 3 , ' Winter ' ) ]\r\n>>> list (enumerate ( seasons , start=2 ) )\r\n[ ( 2 ,' Spring ' ) , ( 3 , ' Summer ' ) , ( 4 , ' Fall ' ) , ( 5 , ' Winter ' ) ] \r\n>>> for num , seasn in enumerate ( seasons , start=1 ) :\r\n. . . print \"[{0}] {1 } \" . format ( num , seasn )\r\n. . . \r\n[1] Spring\r\n[2] Summer\r\n[3] Fall\r\n[4] Winter<\/pre>\n

filter ( function , iterable )
\nCreate a list from those elements of iterable for which function returns True. The iterable may be either a sequence, a container that supports iteration, or an iterator. If iterable is a string or a tuple, the result also has that type, otherwise, it will be a list. If function is None, the identity function is assumed, that is, all elements of iterable that are false are removed.<\/p>\n

>>> def isOdd ( x ) :\r\n. . .               if ( x % 2 )==1: return True\r\n. . .               else : return False\r\n>>> filter ( isOdd, [88 , 43 , 65 ,-11 ,202 ] )\r\n[ 43, 65, -11 ]\r\n>>>\r\n>>> def isLetter ( c ) : return c . isalpha ( )\r\n. . . \r\n>>> filter ( isLetter,\"01234abcdeFGHIJ* ( &!\u2227\")\r\n' abcdeFGHIJ '\r\n>>> list= [ 0, 1, ( ) , (2, ) , 0 . 0, 0 . 25 ]\r\n>>> filter ( None , list )\r\n[1 , (2 ,), 0 . 25 ]\r\n>>> filter ( boo1 , list )\r\n[ 1 , ( 2 , ) , 0 . 25 ]<\/pre>\n

getattr ( object , name [ , default ] )
\nReturn the value of the named attribute of the object; the name must be a string. If the string is the name of one of the object’s attributes, the result is the value of that attribute. If the named attribute does not exist, default is returned if provided, otherwise, AttributeError is raised. For example, a complex number object has real and imag attributes.<\/p>\n

>>> a=3 . 5 + 4 . 9 J \r\n>>> type ( a ) \r\n<type ' complex '>\r\n>>> getattr ( a , ' real ' )\r\n3 . 5\r\n>>> getattr (a , ' imag ' )\r\n4 . 9\r\n>>> getattr ( a ,' imagine ' , 2 . 2 )\r\n2 . 2<\/pre>\n

globals ( )
\nReturn a dictionary representing the current global symbol table. The following script “GlobalScope.py” gives some idea about the use of this function.<\/p>\n

# Filemame: GlobalScope . py \r\nvar1=10 \r\ndef func (  ): \r\nvar2=20 \r\nfunc ( )\r\nif ' var1 ' in globals ( ) . keys ( ) :\r\n            print \"'var1' is a global variable of this module\" \r\nif 'var2' in globals ( ) . keys ( ) :\r\n            print \"'var2' is a global variable of this module\"<\/pre>\n

The output is:<\/strong><\/p>\n

\u2019 var1 ' is a global variable of this module<\/pre>\n

hasattr ( object , name )
\nThe arguments are an object and a string. The result is True, if the string is the name of one of the object’s attributes, otherwise False.<\/p>\n

>>> a=3.5+4.9 J\r\n>>> hasattr( a , ' imag ' ) \r\nTrue \r\n>>> hasattr ( a,' imagine ' ) \r\nFalse<\/pre>\n

hash ( )
\nIn computing, a hash table (also “hash map”) is a data structure that can map keys to values. A hash table uses a hash function to compute an index (or hash value) into an array of buckets or slots, from which the correct value can be found. The built-in function hash ( ) return the hash value of the object (if it has one) which is basically an integer and it never changes during its lifetime.<\/p>\n

Hashability makes an object usable as a dictionary key and a set member because these data structures use the hash value internally. All of Python’s immutable built-in objects are hashable, while no mutable containers (such as lists or dictionaries) are hashable.<\/p>\n

>>> d= { ' Lisa ' : 88 . 5 , ' John ' : 69 . 73 , ' Mike ' : 88 . 5 }\r\n>>> hash ( d [ ' Lisa 1 ' ] )\r\n1485012992\r\n>>> hash ( d [ ' John ' ] )\r\n-1664573625\r\n>>> hash ( d [ ' Mike ' ] )\r\n1485012992<\/pre>\n

\"Python<\/p>\n

Consider the following example :<\/strong><\/p>\n

>>> map ( hash , ( \" namea \" , \" nameb \" , \" namec \" , \" named \" ) )\r\n[-1658398457 , -1658398460 , -1658398459 , -1658398462 ]\r\n>>> map ( hash , ( 0 , 1 , 2 , 3 ) )\r\n[ 0 , 1 , 2 , 3 ]<\/pre>\n

It can be observed that the strings are quite close in their letters, and their hashes are close in terms of numerical distance which is desirable behavior. If the keys are close in nature, one wants their hashes to be close as well so that lookups remain fast. Integers have the same hash value as themselves.<\/p>\n

help ( [ object ] )
\nThis function invokes the built-in help system (this function is intended for interactive use). If no argument is given, the interactive help system starts on the interpreter console. If the argument is a string, then the string is looked up as the name of a module, function, class, method, keyword, or documentation topic, and a help page is printed on the console. If the argument is any other kind of object, a help page on the object is generated.<\/p>\n

>>> help (cmp)\r\nHelp on built-in function cmp in module ____builtin____ :\r\ncmp ( . . . )\r\n\u00a0 \u00a0 cmp ( x , y ) -> integer\r\n\r\n\u00a0 \u00a0 \u00a0 Return negative if x<y , zero if x==y , positive if x>y .<\/pre>\n

hex ( x )
\nConvert an integer number (of any size) to a hexadecimal string. To obtain a hexadecimal string representation for a float, use the float. hex ( ) method.<\/p>\n

>>> hex ( 25 )\r\n' 0x19 '<\/pre>\n

id ( object )
\nReturn the identity of the object. This is an integer (or long integer) which is guaranteed to be unique and constant for this object during its lifetime. Two objects with non-overlapping lifetimes may have the same id ( ) value.<\/p>\n

>>> a=5 \r\n>>> id ( a )\r\n3885104 \r\n>>> b= ' hello '\r\n>>> id ( b )\r\n44148000<\/pre>\n

input ( [ prompt ] )
\nThis function is used to take input from user and evaluates the expression. There is also raw_input ( ) function which takes input from user, convert it to a string, and returns that.<\/p>\n

>>> aa=4 \r\n>>> bb=6\r\n>>> resultl=input( ' ----> ' )\r\n- - - >aa+bb \r\n>>> result2=raw__input ( ' ---> ' )\r\n----->aa+bb\r\n>>>\r\n>>> result1\r\n10\r\n>>> result2\r\n' aa+bb ' \r\n\r\n<\/pre>\n

isinstance ( object , classinfo )
\nReturn True, if the object argument is an instance of the classinfo argument, or of a subclass thereof.<\/p>\n

>>> class new__cls :\r\n. . .\u00a0 \u00a0 \u00a0 \u00a0 def _____init______ ( self , x ) :\u00a0\r\n. . .\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 self . x=x \r\n. . . \r\n>>> tt=new_cls ( 10 )\r\n>>> isinstance ( tt , new_cls )\r\nTrue<\/pre>\n

Also return True, if classinfo is a type object, and an object is an object of that type or of a subclass thereof. If the object is not a class instance or an object of the given type, the function always returns False.<\/p>\n

>>> i=5 \r\n>>> type ( i )\r\n<type ' int '>\r\n>>> type ( int ) \r\n<type ' type ' >\r\n>>> isinstance ( i , int )\r\nTrue\r\n>>> isinstance ( i , str )\r\nFalse<\/pre>\n

If classinfo is neither a class object nor a type object, it may be a tuple of class or type objects (other sequence types are not accepted). If classinfo is not a class, type, or tuple of classes, types, a TypeError exception is raised.<\/p>\n

>>> isinstance( i ,( str , int , float , complex ) )\r\nTrue<\/pre>\n

issubcTass ( class , classinfo )
\nReturn True, if class is a subclass of classinfo.<\/p>\n

>>> class A: \r\n. . .\u00a0 \u00a0 \u00a0 \u00a0 pass\r\n. . . \r\nclass B(A):\r\n. . .\u00a0 \u00a0 \u00a0 \u00a0 pass\r\n. . . \r\n>>> class C: \r\n. . .\u00a0 \u00a0 \u00a0 \u00a0 \u00a0pass\r\n. . . \r\n>>> class D:\r\n. . .\u00a0 \u00a0 \u00a0 \u00a0 pass\r\n. . . \r\n>>> issubclass ( B, A )\r\nTrue<\/pre>\n

A class is considered a subclass of itself.<\/p>\n

>>> issubclass ( D , D )\r\nTrue<\/pre>\n

The classinfo may be a tuple of class objects, in which case every entry in classinfo will be checked. In any other case, a TypeError exception is raised.<\/p>\n

>>> issubclass ( B , ( A , C , D ) )\r\nTrue<\/pre>\n

len ( s )
\nReturn the length (the number of items) of an object s. The argument may be a sequence (string, tuple or list) or a mapping (dictionary).<\/p>\n

>>> len ( ' abed ' )\r\n4\r\n>>> seq=[ ' a ' , ' b ' , ' c ' , ' d ' ]\r\n>>> len ( seq )\r\n4\r\n>>> seq= ( ' a ' , 'b \\ 'c \\ 'd')\r\n>>> len ( seq )\r\n4\r\n>>> dict= { ' a ' : 8 , ' b ' :\u00a0 9 , ' c ' : 10 , ' d ' : 11 }\r\n>>> len ( diet )\r\n4 '\r\n>>> len ( ' ' )\r\n0<\/pre>\n

locals ( )
\nThe function returns a dictionary representing the current local symbol table.<\/p>\n

# ! \/ usr \/ bin \/ env python \r\n# Filemame: LocalScope . py \r\nvar1=10\r\nvar2=20 \r\n    def func ( ) :\r\n      var3=30 \r\n       var4=40\r\nprint ' Local variables of func ( ) = ',locals ( ) \r\nfunc ( )\r\nif 'var1' in locals ( ).keys ( ) and 'var2' in locals ( ) . keys( ) :\r\n    print \"'var1': and ' var2 ' are local variables of this module\"<\/pre>\n

Output is:<\/strong><\/p>\n

Local variables of func( )= { ' var4 ' : 40 , ' var3 ' : 30 }\r\n' var1 ' and ' var2 ' are local variables of this module<\/pre>\n

map ( function,iterable, . . . )
\nApply function to every item of iterable and return a list of the results. If additional iterable arguments are passed, the function must take that many arguments and is applied to the items from all iterables in parallel. If one iterable is shorter than another, it is assumed to be extended with None items.<\/p>\n

If the function is None, the identity function is assumed; if there are multiple arguments, map ( ) returns a list consisting of tuples containing the corresponding items from all iterables. The iterable arguments may be a sequence or any iterable object; the result is always a list.<\/p>\n

>>> def add100 ( x ) :\r\n. . .\u00a0 \u00a0 \u00a0 \u00a0 return x+100\r\n. . .\r\n>>> map ( add100 , ( 44 , 22 , 66 ) )\r\n[ 144 , 122 , 166 ]\r\n>>>\r\n>>> def abc ( a , b , c ) :\r\n. . .\u00a0 \u00a0 \u00a0 \u00a0 return a*10000+b*100+c\r\n. . . \r\n>>> map ( abc , ( 1 , 2 , 3 ) , ( 4 , 5 , 6 ) , ( 7 , 8 , 9 ) )\r\n[ 10407 , 20508 , 30609 ]\r\n>>>\r\n>>> map ( None , range ( 3 ) )\r\n[ 0 , 1 , 2 ]\r\n>>> map (None,range ( 3 ) , ' abc ' , [ 44 , 55 , 66 ] )\r\n[ ( 0 , ' a ' , 44 ) , ( 1, -b \u2019 , 55 ) , ( 2 , *c ', 66 ) ]<\/pre>\n

max ( iterable [ , key ] )
\nReturn the largest item in an iterable. The optional argument key specifies a function of one argument that is used to extract a comparison key from each list element. The default value is None (compare the elements directly),<\/p>\n

>>> max ( ' hello ' )\r\n' o '\r\n>>> max ( [10, 80, 90, 20,-100] )\r\n90 \r\n>>> def LessThanFifty ( x ) :\r\n. . .\u00a0 \u00a0 \u00a0 \u00a0 \u00a0if x<=50 :\r\n. . .\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return x\r\n>>> max ( [ 10 , 80 , 90 , 20 , -100 ] , key=LessThanFifty )\r\n20<\/pre>\n

The function has another form max (arg1, arg2, *args [, key] ), which returns the largest of two or more arguments.<\/p>\n

>>> max ( ' hi ' ,\u00a0 ' hello ' ,\u00a0 ' bye ' ) \r\n' hi '\r\n>>> max ( ' Gumby ' , ' Lambert ' , ' Sartre ' , ' Cheddar ' )\r\n' Cheddar '\r\n>>> max ( ' Gumby ' , ' Lambert ' , ' Sartre ' , ' Cheddar ' , key=str.upper )\r\n' Sartre '<\/pre>\n

min ( iterable [ , key ] )
\nReturn the smallest item in an iterable. The key has same meaning as that in max ( ) function.<\/p>\n

>>> min ( ' hello' )\r\n' e '\r\n>>> min ( ( 10 , 80 , 90 , 20 , -100 } )\r\n-100<\/pre>\n

The function has another form min (arg1, arg2, *args [ , key] ), which returns the smallest of two or more arguments.<\/p>\n

>>> min ( 10 , 80 , 90 , 20 , -100 )\r\n-100\r\n>>> def rev ( x ) : return -x\r\n. . .\u00a0\r\n>>> min ( 10 , 80 , 90 , 20 , -100 , key=rev )\r\n90<\/pre>\n

next ( iterator [ , defauIt ] )
\nRetrieve the next item from the iterator. If the default is given, it is returned if the iterator is exhausted, otherwise, Stoplteration is raised.<\/p>\n

>>> it=iter ( xrange ( 0 , 3 ) )\r\n>>> next ( it , ' Done ' )\r\n0\r\n>>> next ( it , ' Done ' )\r\n1\r\n>>> next ( it ,\u00a0 'Done ' )\u00a0\r\n2\u00a0\r\n>>> next ( it , ' Done ' )\u00a0\r\n' Done '\r\n>>> next ( it , ' Done ' )\r\n' Done '\u00a0\r\n>>> it=iter ( xrange ( 0 , 3 ) )\r\n>>> next ( it )\r\n0\r\n>>> next ( it )\r\n1 \r\n>>> next ( it )\r\n2\r\n>>> next ( it )\u00a0\r\nTraceback ( most recent call last ) :\r\nFile \"<stdin>\", line 1, in <module>\r\nStoplteration<\/pre>\n

oct ( x )
\nConvert an integer number (of any size) to an octal string.<\/p>\n

>>> oct ( 135 )\r\n' 0207 '<\/pre>\n

pow ( x , y [ , z ] )
\nReturn x to the power y; if z is present, return x to the power y, and modulo z (computed more efficiently than pow (x, y) %z). The two-argument form pow (x, y) is equivalent to using the power operator x* *y. The arguments must be of numeric types. If the second argument is negative, the third argument must be omitted. If z is present, x and y must be of integer types, and y must be non-negative.<\/p>\n

>>> 2 * * 4 \r\n16\r\n>>> pow ( 2 , 4 )\r\n16\r\n>>> ( 2 * * 4 ) % 3 \r\n1\r\n>>> pow ( 2 , 4 ,3 )\r\n1<\/pre>\n

print ( * objects , sep=’ ‘ , end=’ \\ n ‘ , file=sys . stdout )
\nPrint objects to the stream file, separated by sep and followed by end. If sep, end and file, are present, they must be given as keyword arguments. All non-keyword arguments are converted to strings and written to the stream, separated by sep and followed by end. Both sep and end must be strings, they can also be None, which means to use the default values. If no objects are given, print ( ) will just write end. The file argument must be an object with a write ( ) method, if it is not present or None, sys. stdout (file objects corresponding to the interpreter’s standard output stream) will be used.<\/p>\n

This function is not normally available as a built-in function, since the name print is recognized as the print statement. To disable the statement and use the print ( ) function, use the following future statement before using the function.<\/p>\n

>>> from _____future______ import print_function\r\n>>> x , y=3 , 5\r\n>>> print ( ' The sum of ' , x , ' plus ' , y , ' is ' , x+y )\r\nThe sum of 3 plus 5 is 8\r\n>>> print ( ' The sum of ' , x , ' plus ' , y , ' is ' , x+y , sep =' ' )\r\nThe sum of 3 plus 5 is 8\r\n>>> print ( ' The sum of ' , x , ' plus ' , y , ' is ' , x+y , sep='\u00a0 ' , end=' \\ n The \\ n End \\ n ' )\r\nThe sum of 3 plus 5 is 8\r\nThe \r\nEnd<\/pre>\n

range( start,stop[,step] )
\nThis function creates list whose elements are in arithmetic progression. The arguments must be plain integers. If the step argument is omitted, it defaults to 1. If the start argument is omitted, it defaults to 0. step must not be zero (or else ValueError is raised).<\/p>\n

>>> range ( 10 )\r\n[ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ]\r\n>>> range ( 1 , 11 ) \r\n[ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ]\r\n>>> range ( 0 , 30 , 5 ) \r\n[ 0 , 5 , 10 , 15 , 20 , 25 ]\r\n>>> range ( 0 , 10 , 3 ) \r\n[ 0 , 3 , 6 , 9 ] \r\n>>> range ( 0 , -10 , -1 ) \r\n[ 0 , -1 , -2 , -3 , -4 , -5 , -6 , -7 , -8 , -9 , ]\r\n>>> range ( 0 )\r\n[ ]\r\n>>> range ( 10 , 5 )\r\n[ ]\r\n>>> range ( 10 , 5 , -1 )\r\n[ 10 , 9 , 8 , 7 , 6 ]<\/pre>\n

reload ( module )
\nReload a previously imported module. The argument must be a module object, so it must have been successfully imported before. This is useful if the programmer has edited the module’s source file using an external editor and wants to try out the new version without leaving the Python interpreter. The return value is the module object.<\/p>\n

reversed ( seq )
\nThe function returns an iterator object that can iterate over all the objects in the container in reverse order.<\/p>\n

>>> Seq= [ 10, 20, 30 ]\r\n>>> revSeq=reversed ( Seq ) \r\n>>> for item in revSeq: print item\r\n. . . \r\n30 \r\n20\r\n10<\/pre>\n

round ( number [ , ndigits ] )
\nReturn the floating-point value number rounded to digits after the decimal point. If digits are omitted, it defaults to zero.<\/p>\n

>>> round ( 2 .769753 )\r\n3 . 0\r\n>>> round ( -2 . 769753 )\r\n-3 . 0 \r\n>>> round ( 2 . 769753 , 4 )\r\n2 . 7698\r\n>>> round ( -2 . 769753 , 4 )\r\n-2 . 7698<\/pre>\n

setattr ( object, name, value )
\nThis is the counterpart of getattr ( ). The arguments are an object, a string, and an arbitrary value. The string may name an existing attribute or a new attribute. The function assigns the value to the attribute, provided the object allows it. The following example will become clearer after going through chapter 6.<\/p>\n

>>> class new_cls:\r\n. . .\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0def init ( self , x ) :\r\n. . .\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0self . x=x\r\n>>> tt=new_cls ( 10 )\r\n>>> tt.x \r\n10\r\n>>> setattr ( tt , ' x ' , 20 )\r\n>>> tt.x \r\n20\r\n>>> setattr ( tt , ' yhello ' )\r\n>>> tt.y \r\n' hello '<\/pre>\n

slice ( start , stop [ , step ] )
\nReturn a slice object representing the set of indices specified by range (start, stop, step). The function can also be of form slice (stop), where the start and step arguments default to None. Slice objects have read-only data attributes start, stop, and step, which merely returns the argument values (or their default).<\/p>\n

>>> slice ( 20 ) \r\nslice ( None , 20 , None )\r\n>>> s1=slice ( 2 , 20 , 3 ) \r\n>>> type ( s1 ) \r\n<type ' slice ' >\r\n>>> s1 . start \r\n2 \r\n>>> s1 . stop \r\n20\r\n>>> s1 . step \r\n3<\/pre>\n

The slice object can be passed to the ________getitem__________ ( ) method of the built-in sequences.<\/p>\n

>>> range ( 50 ). getitem ( s1 )\r\n[ 2 , 5 , 8 , 11 , 14 , 17 ]<\/pre>\n

Or use slice objects directly in subscripts:<\/p>\n

>>> range ( 50 ) [ s1 ]\r\n[ 2 , 5 , 8 , 11 , 14 , 17 ]<\/pre>\n

sorted ( iterable [ , cmp [ , key [ , reverse] ] ] )
\nReturn a new sorted list from the items in iterable. The arguments cmp, key, and reverse are optional.<\/p>\n

>>> a= [ 66 . 25 , 333 , ' abc ' , 333 , 1 , \u2019 ab ' , 1234 . 5 ]\r\n>>> sorted ( a )\r\n[ 1 , 66 . 25 , 333 , 333 , 1234 . 5 , ' ab ' , ' abc ' ]\r\n>>> sorted ( { 10 : ' D ' , 5 : ' B ' , 8 : ' B ' , 6 : ' E ' , 2 : ' A ' } )\r\n[ 2 , 5 , 6 , 8 , 10 ]<\/pre>\n

cmp specifies a custom comparison function of two arguments (iterable elements) which should return a negative, zero or positive number depending on whether the first argument is considered smaller than, equal to, or larger than the second argument. The default value is None.<\/p>\n

key specifies a function of one argument that is used to extract a comparison key from each list element. The default value is None (compare the elements directly).<\/p>\n

>>> strs= [ ' ccc ' , ' aaaa ' , ' d ' , ' bb ' ]\r\n>>> sorted ( strs , key=len)\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0          # Sorted by string length\r\n[ ' d ' , ' bb ' , ' ccc ' , 'aaaa ' ]\r\n>>> student_tuples=[\r\n. . . ( ' john ' , ' A ' , 15 ) ,\r\n. . . ( ' jane ' , ' B ' , 12 ) ,\r\n. . . ( ' dave ' , ' B ' , 10 ) , ]\r\n>>> sorted ( student_tuples , key=lambda student : student [ 2 ] )                        # By age \r\n[ ( ' dave ' , ' B ' , 10 ) , ( ' jane ' , ' B ' , 12 ) , ( ' john ' , ' A ' , 15 ) ]<\/pre>\n

the reverse is a boolean value. If set to True, then the list elements are sorted as if each comparison were reversed.<\/p>\n

>>> a= [ 66 . 25 , 333 , ' abc ' , 333 , 1 , ' ab ' , 1234 . 5 ]\r\n>>> sorted ( a , reverse = True )\r\n[ ' abc ' , ' ab ' , 1234 . 5 , 333 , 333 , 66 . 25 , 1 ]<\/pre>\n

In general, the key and reverse conversion processes are much faster than specifying an equivalent cmp function. This is because cmp is called multiple times for each list element, while key and reverse touch each element only once.<\/p>\n

>>> L= [ ' geas ' , ' clue ' , ' Zoe ' , ' Ann ' ]\r\n>>> sorted ( L )\r\n[ ' Ann ' , ' Zoe ' , ' clue ' , ' geas ' ]\r\n>>> def ignoreCase(x,y) :\r\n. . . return cmp ( x . upper ( ) , y . upper ( ) ) \r\n. . . \r\n>>> sorted ( L , ignoreCase )\r\n[ ' Ann ' , ' clue ' , ' geas ' , ' Zoe ' ]\r\n>>> sorted ( L , None , str . upper )\r\n[ ' Ann ' , \u2019 clue ' , ' geas ' , \u2019 Zoe ' ]\r\n>>> L\r\n[ ' geas ' , ' clue ' , ' Zoe ' , ' Ann ' ] \r\n\r\n<\/pre>\n

sum ( iterable [ , start ] )
\nThe function returns the sum total of start ( defaults to 0 ) and the items of an iterable.<\/p>\n

>>> seq= [ 5 , 7 . 4 , 2 , 11 ]\r\n>>> sum ( seq )\r\n25 . 4\r\n>>> sum ( seq , 10 . 2 )\r\n35 . 6\r\n>>> aa=4\r\n>>> bb=2 . 5\r\n>>> cc=9 . 1\r\n>>> seq= [ aa , bb , cc ]\r\n>>> sum ( seq )\r\n15 . 6<\/pre>\n

type ( object )
\nThe function returns the type of an object.<\/p>\n

>>> i=50 . 7 \r\n>>> type ( i )\r\n<type ' float '>\r\n>>> type ( i ) is float \r\nTrue<\/pre>\n

xrange ( start , stop [ , step ] )
\nThis function is very similar to range ( ), but returns an xrange object instead of a list. This yields the same values as the corresponding list, without actually storing them all simultaneously. The advantage of xrange ( ) over range ( ) is minimal, except when a very large range is used on a memory-starved machine or when all of the range ( ) elements are never used (such as when the loop is usually terminated with break). The function can also be used as xrange (stop).<\/p>\n

The xrange type is an immutable sequence that is commonly used for looping. The advantage of the xrange type is that an xrange object will always take the same amount of memory, no matter the size of the range it represents. There are no consistent performance advantages. The xrange objects support indexing, iteration, and the len ( ) function.<\/p>\n

>>> for i in xrange ( 2000000000 ) :\r\n. . . print i\r\n. . . if i > 5 :\r\n. . . break \r\n. . . \r\n0\r\n1\r\n2\r\n3\r\n4\r\n5\r\n6\r\n>>> for i in range ( 2000000000 ) :\r\n. . . print i\r\n. . . if i>5 :\r\n. . . break\r\n. . .\r\nTraceback ( most recent call last ) :\r\nFile \"<stdin>\", line 1, in <module>\r\nMemoryError<\/pre>\n

zip ( [ iterable , . . . ] )
\nThis function returns a list of tuples, where the \/th<\/sup> tuple contains the \/th<\/sup> element from each of the argument sequences or iterables. The returned list is truncated in length to the length of the shortest argument sequence. When there are multiple arguments that are all of the same lengths, zip ( ) is similar to map ( ) with an initial argument of None. With no arguments, it returns an empty list, zip ( ) in conjunction with the * operator can be used to unzip a list:<\/p>\n

>>> x= [ 1 , 2 , 3 ]\r\n>>> y=[ 4 , 5 , 6 , 7 , 8 ]\r\n>>> zipped=zip ( x , y )\r\n>>> zipped\r\n[ ( 1 , -4 ) , ( 2 , 5 ) , ( 3 , 6 ) ]\r\n>>> zip ( x )\r\n[ ( 1 , ) , ( 2 , ) , ( 3 , ) ]\r\n>>> x2 , y2=zip ( *zipped )\r\n>>> x2 \r\n( 1 , 2 , 3 )\r\n>>> y2 \r\n( 4 , 5 , 6 )\r\n>>> zip ( ) \r\n[ ]<\/pre>\n","protected":false},"excerpt":{"rendered":"

In this Page, We are Providing Python Programming \u2013 Compound statement Built-in functions. Students can visit for more Detail and Explanation of Python Handwritten Notes\u00a0Pdf. Python Programming \u2013 Compound statement Built-in functions Built-in functions Till now, the discussed functions need to be defined before using it in a program; such functions are called user-defined functions. …<\/p>\n

Python Programming \u2013 Compound statement Built-in functions<\/span> Read More »<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[5],"tags":[],"yoast_head":"\nPython Programming \u2013 Compound statement Built-in functions - Python Programs<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Programming \u2013 Compound statement Built-in functions - Python Programs\" \/>\n<meta property=\"og:description\" content=\"In this Page, We are Providing Python Programming \u2013 Compound statement Built-in functions. Students can visit for more Detail and Explanation of Python Handwritten Notes\u00a0Pdf. Python Programming \u2013 Compound statement Built-in functions Built-in functions Till now, the discussed functions need to be defined before using it in a program; such functions are called user-defined functions. … Python Programming \u2013 Compound statement Built-in functions Read More »\" \/>\n<meta property=\"og:url\" content=\"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Programs\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/btechgeeks\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-20T06:10:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-10T06:20:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/04\/Python-Handwritten-Notes-Chapter-3-img-1.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@btech_geeks\" \/>\n<meta name=\"twitter:site\" content=\"@btech_geeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prasanna\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"23 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/python-programs.com\/#organization\",\"name\":\"BTech Geeks\",\"url\":\"https:\/\/python-programs.com\/\",\"sameAs\":[\"https:\/\/www.instagram.com\/btechgeeks\/\",\"https:\/\/www.linkedin.com\/in\/btechgeeks\",\"https:\/\/in.pinterest.com\/btechgeek\/\",\"https:\/\/www.youtube.com\/channel\/UC9MlCqdJ3lKqz2p5114SDIg\",\"https:\/\/www.facebook.com\/btechgeeks\",\"https:\/\/twitter.com\/btech_geeks\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/python-programs.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png\",\"contentUrl\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png\",\"width\":350,\"height\":70,\"caption\":\"BTech Geeks\"},\"image\":{\"@id\":\"https:\/\/python-programs.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/python-programs.com\/#website\",\"url\":\"https:\/\/python-programs.com\/\",\"name\":\"Python Programs\",\"description\":\"Python Programs with Examples, How To Guides on Python\",\"publisher\":{\"@id\":\"https:\/\/python-programs.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/python-programs.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/#primaryimage\",\"url\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/04\/Python-Handwritten-Notes-Chapter-3-img-1.png\",\"contentUrl\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/04\/Python-Handwritten-Notes-Chapter-3-img-1.png\",\"width\":518,\"height\":364,\"caption\":\"Python Handwritten Notes Chapter 3 img 1\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/#webpage\",\"url\":\"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/\",\"name\":\"Python Programming \u2013 Compound statement Built-in functions - Python Programs\",\"isPartOf\":{\"@id\":\"https:\/\/python-programs.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/#primaryimage\"},\"datePublished\":\"2023-10-20T06:10:34+00:00\",\"dateModified\":\"2023-11-10T06:20:27+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/python-programs.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python Programming \u2013 Compound statement Built-in functions\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/#webpage\"},\"author\":{\"@id\":\"https:\/\/python-programs.com\/#\/schema\/person\/ea8ce699662f0d7e248e52fe080b85bb\"},\"headline\":\"Python Programming \u2013 Compound statement Built-in functions\",\"datePublished\":\"2023-10-20T06:10:34+00:00\",\"dateModified\":\"2023-11-10T06:20:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/#webpage\"},\"wordCount\":2401,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/python-programs.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/04\/Python-Handwritten-Notes-Chapter-3-img-1.png\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/#respond\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/python-programs.com\/#\/schema\/person\/ea8ce699662f0d7e248e52fe080b85bb\",\"name\":\"Prasanna\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/python-programs.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g\",\"caption\":\"Prasanna\"},\"url\":\"https:\/\/python-programs.com\/author\/prasanna\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python Programming \u2013 Compound statement Built-in functions - Python Programs","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/","og_locale":"en_US","og_type":"article","og_title":"Python Programming \u2013 Compound statement Built-in functions - Python Programs","og_description":"In this Page, We are Providing Python Programming \u2013 Compound statement Built-in functions. Students can visit for more Detail and Explanation of Python Handwritten Notes\u00a0Pdf. Python Programming \u2013 Compound statement Built-in functions Built-in functions Till now, the discussed functions need to be defined before using it in a program; such functions are called user-defined functions. … Python Programming \u2013 Compound statement Built-in functions Read More »","og_url":"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/","og_site_name":"Python Programs","article_publisher":"https:\/\/www.facebook.com\/btechgeeks","article_published_time":"2023-10-20T06:10:34+00:00","article_modified_time":"2023-11-10T06:20:27+00:00","og_image":[{"url":"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/04\/Python-Handwritten-Notes-Chapter-3-img-1.png"}],"twitter_card":"summary_large_image","twitter_creator":"@btech_geeks","twitter_site":"@btech_geeks","twitter_misc":{"Written by":"Prasanna","Est. reading time":"23 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/python-programs.com\/#organization","name":"BTech Geeks","url":"https:\/\/python-programs.com\/","sameAs":["https:\/\/www.instagram.com\/btechgeeks\/","https:\/\/www.linkedin.com\/in\/btechgeeks","https:\/\/in.pinterest.com\/btechgeek\/","https:\/\/www.youtube.com\/channel\/UC9MlCqdJ3lKqz2p5114SDIg","https:\/\/www.facebook.com\/btechgeeks","https:\/\/twitter.com\/btech_geeks"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/python-programs.com\/#\/schema\/logo\/image\/","url":"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png","contentUrl":"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png","width":350,"height":70,"caption":"BTech Geeks"},"image":{"@id":"https:\/\/python-programs.com\/#\/schema\/logo\/image\/"}},{"@type":"WebSite","@id":"https:\/\/python-programs.com\/#website","url":"https:\/\/python-programs.com\/","name":"Python Programs","description":"Python Programs with Examples, How To Guides on Python","publisher":{"@id":"https:\/\/python-programs.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/python-programs.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/#primaryimage","url":"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/04\/Python-Handwritten-Notes-Chapter-3-img-1.png","contentUrl":"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/04\/Python-Handwritten-Notes-Chapter-3-img-1.png","width":518,"height":364,"caption":"Python Handwritten Notes Chapter 3 img 1"},{"@type":"WebPage","@id":"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/#webpage","url":"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/","name":"Python Programming \u2013 Compound statement Built-in functions - Python Programs","isPartOf":{"@id":"https:\/\/python-programs.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/#primaryimage"},"datePublished":"2023-10-20T06:10:34+00:00","dateModified":"2023-11-10T06:20:27+00:00","breadcrumb":{"@id":"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/python-programs.com\/"},{"@type":"ListItem","position":2,"name":"Python Programming \u2013 Compound statement Built-in functions"}]},{"@type":"Article","@id":"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/#article","isPartOf":{"@id":"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/#webpage"},"author":{"@id":"https:\/\/python-programs.com\/#\/schema\/person\/ea8ce699662f0d7e248e52fe080b85bb"},"headline":"Python Programming \u2013 Compound statement Built-in functions","datePublished":"2023-10-20T06:10:34+00:00","dateModified":"2023-11-10T06:20:27+00:00","mainEntityOfPage":{"@id":"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/#webpage"},"wordCount":2401,"commentCount":0,"publisher":{"@id":"https:\/\/python-programs.com\/#organization"},"image":{"@id":"https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/#primaryimage"},"thumbnailUrl":"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/04\/Python-Handwritten-Notes-Chapter-3-img-1.png","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/python-programs.com\/python-programming-compound-statement-built-in-functions\/#respond"]}]},{"@type":"Person","@id":"https:\/\/python-programs.com\/#\/schema\/person\/ea8ce699662f0d7e248e52fe080b85bb","name":"Prasanna","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/python-programs.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g","caption":"Prasanna"},"url":"https:\/\/python-programs.com\/author\/prasanna\/"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts\/3220"}],"collection":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/comments?post=3220"}],"version-history":[{"count":7,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts\/3220\/revisions"}],"predecessor-version":[{"id":3239,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts\/3220\/revisions\/3239"}],"wp:attachment":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/media?parent=3220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/categories?post=3220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/tags?post=3220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}