(continued from previous page intadd addintex( , print("intadd ="intadd adding stringsundesired result attribute validation is used for avoiding such errors stradd addintex("meher ""krishna"print("stradd ="straddmeher krishna keyword argument in listing 'addkeywordarg( * )is python featurein which all the arguments after '*are considered as positional argument hence'xand 'yare the 'positionaland 'keywordargument respectively keyword arguments must be defined using the variable name ' = as shown in lines and if name of the variable is not explicitly usedthen python will generate error as shown in line furtherkeyword argument must be defined after all the positional argumentsotherwise error will be generated as shown in line lastlyin line the definition 'addkeywordarg(xint*yint-intis presenting that inputs ( and yand return values are of integer types these help features can be viewed using metaclass commandi __annotations__'as shown in lines and note thatthis listing is not validating input types in next sectioninput validation is applied for the functions listing keyword argument addkeywordarg py def addkeywordarg( :int* :int-int'''add two numbersxintegerpostional argument yintegerkeyword argument returntypeinteger ''return ( + add addkeywordarg( = xpositional arg and ykeyword arg print(add add addkeywordarg( = = and as keyword argument print(add #it' wrongbecause is not defined as keyword argument #add addpositionalarg( should be keyword argument = #keyword arg should come after positional arg #add addpositionalarg( = correct ( = help(addkeywordarglines - will be displayed as output print(addkeywordarg __annotations__#{'return'' '' ' #line is only help (not validation) string addition will still unchecked stradd addkeywordarg("meher " "krishna"print("stradd ="stradd input validation in previous sectionhelp features are added to functionsso that the information about the functions can be viewed by the users in this sectionvalidation is applied to input argumentsso that any invalid input will not be process by the function and corresponding error be displayed to the user generalized attribute validation