Tag Archives: Python-Output

Output of Python program | Set 5

Predict the output of the following programs: Program 1: Output: cool Explanation: There is a docstring defined for this method, by putting a string on the first line after the start of the function definition. The docstring can be referenced using the __doc__ attribute of the function. And hence it prints the indexed string. Program… Read More »

Output of Python Program | Set 3

Difficulty level : Intermediate Predict the output of following Python Programs. Program 1: Output: 51 Explanation : In the above program we are creating a member variable having name ‘life’ by adding it directly to the dictionary of the object ‘manager’ of class ‘Geeks’. Total numbers of items in the dictionary is 2, the variables… Read More »

Output of Python Program | Set 1

Predict the output of following python programs: Program 1: Output: 24 Explanation : In the above program r and s are lambda functions or anonymous functions and q is the argument to both of the functions. In first step we have initialized x to 2. In second step we have passed x as argument to… Read More »