1.

What is the length of sys.argv?(a) number of arguments(b) number of arguments + 1(c) number of arguments – 1(d) none of the mentionedThe question was asked in an online quiz.Question is from Argument Parsing 1 in division Argument Passing, Global vs Local Variables, Shallow copy vs Deep copy and Recursion of Python

Answer»

The CORRECT answer is (b) NUMBER of ARGUMENTS + 1

Explanation: The first argument is the name of the program itself. Therefore the length of sys.argv is one more than the number arguments.



Discussion

No Comment Found

Related InterviewSolutions