Tag: MCQ
-
Python Multiple Choice Questions – Argument Parsing
Python Multiple Choice Questions & Answers (MCQs) focuses on “Argument Parsing”. Q 1. What is the type of each element in sys.argv?A. setB. listC. tupleD. string Show Answer Answer:-D. string Explanation It is a list of strings. Q 2. What is the length of sys.argv?A. number of argumentsB. number of arguments + 1C. number of…
-
Python Questions and Answers – Argument Parsing 2
Python Multiple Choice Questions & Answers (MCQs) focuses on “Argument Parsing”. Q 1. What will be the output of the following Python code? def foo(k):k = [1]q = [0]foo(q)print(q)A. [0]B. [1]C. [1, 0]D. [0, 1] Show Answer Answer:-A. [0] Explanation A new list object is created in the function and the reference is lost. This…
-
Python Multiple Choice Questions – Function
Python Multiple Choice Questions & Answers (MCQs) focuses on “Function”. Q 1. Which of the following is the use of function in python?A. you can’t also create your own functions B. Functions don’t provide better modularity for your applicationC. Functions are reusable pieces of programsD. All of the mentioned Show Answer Answer:-C. Functions are reusable…
-
Python Questions and Answers – Global vs Local Variables – 2
Python Multiple Choice Questions & Answers (MCQs) focuses on “Global vs Local Variables – 2”. Q 1. Which of the following data structures is returned by the functions globals() and locals()?A. listB. setC. dictionaryD. tuple Show Answer Answer:-C. dictionary Explanation Both the functions, that is, globals() and locals() return value of the data structure dictionary.…
-
C++ Programming Questions and Answers – Standard Template Library
C++ Programming Multiple Choice Questions & Answers (MCQs) focuses on “Standard Template Library”. Q 1. What is the Standard Template Library?A. Set of C++ classesB. Set of C++ template classes to provide common programming data structures and functionsC. Set of Template functions used for easy data structures implementationD. Set of Template data structures only Show…
-
C++ Programming MCQ – Templates
C++ Programming Multiple Choice Questions & Answers (MCQs) focuses on “Templates”. Q 1. Which of the following is used for generic programming?A. Virtual functionsB. ModulesC. TemplatesD. Abstract Classes Show Answer Answer:-C. Templates Explanation Templates are used for generic programming. They help in making generic functions and classes hence achieving the generic codes. Q 2. Which…
-
C++ Programming MCQ – Specialization
C++ interview questions and answers focuses on “Specialization “. One shall practice these interview questions to improve their C++ programming skills needed for various interviews (campus interviews, walk-in interviews, company interviews) entrance exams and other competitive exams. These questions can be attempted by anyone focusing on learning C++ programming language. They can be a beginner,…
-
C++ Programming Questions and Answers – Class Templates
C++ Programming Multiple Choice Questions & Answers (MCQs) focuses on “Class Templates”. Q 1. What is the syntax of class template?A. temp <paramaters> class declarationB. Template <paramaters> class declarationC. template <paramaters> class declarationD. Temp <paramaters> class declaration Show Answer Answer:-C. template class declaration Explanation Syntax involves template keyword followed by list of parameters in angular…
-
Python Questions and Answers – Dictionary – 4
Python Multiple Choice Questions & Answers (MCQs) focuses on “Dictionary – 4”. Q 1. The following Python code is invalid. class demo(dict):def __test__(self,key):return []a = demo()a[‘test’] = 7print(a)A. TrueB. False Show Answer Answer:-B. False Explanation The output of the code is: {‘test’:7}. Q 2. What will be the output of the following Python code? count={}count[(1,2,4)]…
-
Python Questions and Answers – Dictionary – 2
Python Multiple Choice Questions & Answers (MCQs) focuses on “Dictionary – 2”. Q 1. Which of these about a dictionary is false?A. The values of a dictionary can be accessed using keysB. The keys of a dictionary can be accessed using valuesC. Dictionaries aren’t orderedD. Dictionaries are mutable Show Answer Answer:-B. The keys of a…