1.

The output of the function len(sys.argv) is ____________(a) Error(b) 1(c) 0(d) Junk valueI had been asked this question by my school teacher while I was bunking the class.Origin of the question is Sys Module in chapter Mapping Functions and Modules of Python

Answer»

The CORRECT OPTION is (b) 1

Explanation: The output of the FUNCTION sys.argv is [‘ ‘]. When we execute the function len([‘ ‘]), the output is 1. HENCE the output of the function len(sys.argv) is also 1.



Discussion

No Comment Found

Related InterviewSolutions