Q. Identify the mentioned parts from the code given below.


1. def lastDigitCube(n) :
2. d = n % 10
3. c = d ** 3
4. return c
5.
6. number = int(input("Enter a number :") )
7. cube lastDigitCube(number)
8. print("The cube of its last digit is", cube)

 
(a) Function header
(b) Number & name of arguments
(c) Number of statements in function body
(d) Number of statements in main program (__main__)
(e) Function call statement
(f) Parameters' name
(g) Arguments' name
(h) Flow of execution
mention the execution order of statements e.g., main.1 means main program's statementl executed and fn.1 means function's statementl executed.
A sample order could be main.1, fn.1, main.2 etc.
(This flow of execution is not for above code : p)]

Answer :-

 
(a) Function header def lastDigitCube(n) :
(b) Number & name of arguments One argument name is ‘n’
(c) Number of statements in function body Three
(d) Number of statements in main program (__main__) 0
(e) Function call statement lastDigitCube(n)
(f) Parameters' name n
(g) Arguments' name number
(h) Flow of execution
[mention the execution order of statements e.g., main.1 means main program's statementl executed and fn.1 means function's statementl executed.
A sample order could be main.1, fn.1, main.2 etc.
(This flow of execution is not for above code : p)]
6-> 7-> 1-> 2 -> 3 -> 4-> 7-> 8

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post