Keyword argument<\/strong><\/p>\nKeyword argument is an argument preceded by an identifier (e.g. name=) in a function call or passed as a value in a dictionary preceded by **. For example, 10, 20, 30, and 40 are keyword arguments in the following calls to summation ( ) function:<\/p>\n
>>> def summation( aa , bb , cc , dd ) : \r\n. . .\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 print ' aa : ' , aa\r\n. . .\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 print ' bb : ' , bb\r\n. . .\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 print ' cc : ' , cc\r\n. . .\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 print ' dd : ' , dd\r\n. . .\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 total=aa+bb+cc+dd\r\n. . .\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return total\r\n. . .\r\n>>> sumupl=summation( bb=20 , dd=40 , aa=10 , cc=30 )\r\naa : 10\r\nbb : 20\r\ncc : 30\r\ndd : 40 \r\n>>> print ' Sum is: ' , sumupl \r\nSum is : 100\r\n>>> sumup2=summation(** { ' bb ' : 20 , ' dd ' : 40 , ' aa ' : 10 , ' cc ' : 30 } ) \r\naa : 10\r\nbb : 20\u00a0\r\ncc : 30\r\ndd : 4 0\r\n>>> print 'Sum is:',sumup2 \r\nSum is: 100<\/pre>\nPositional argument<\/strong><\/p>\nPositional argument is an argument that is not a keyword argument. Positional arguments can appear at the beginning of an argument list and can also be passed as elements of an iterable preceded by *. For example, 10, 20, 30 and 40 are positional arguments in the following calls to summation ( ) function:<\/p>\n
>>> def summation ( aa , bb , cc , dd ): \r\n. . . print ' aa : ' , aa\r\n. . . print ' bb : ' , bb\r\n. . . print ' cc : ' , cc\r\n. . . print ' dd : ', dd\r\n. . . total=aa+bb+cc+dd\r\n. . . return total\r\n>>> sumup3=summation( 10 , 20 , 30 , 40 )\r\naa : 10\r\nbb : 20\r\ncc : 30\r\ndd : 40\r\n>>> print 'Sum is:',sumup3 \r\nSum is : 100\r\n>>> sumup4=summation( * ( 10 , 20 , 30 , 40 ) )\r\naa : 10\r\nbb : 20\r\ncc : 30\r\ndd : 40\r\n>>> print ' Sum is : ',sumup4 \r\nSum is : 100<\/pre>\n","protected":false},"excerpt":{"rendered":"In this Page, We are Providing Python Programming \u2013 Compound statement Functions Argument. Students can visit for more Detail and Explanation of Python Handwritten Notes\u00a0Pdf. Python Programming \u2013 Compound statement Functions Argument Argument The argument is the value passed to a function (or method) while calling the function. There are two types of arguments: Keyword …<\/p>\n
Python Programming \u2013 Compound statement Functions Argument<\/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 Functions Argument - Python Programs<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n