This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 42 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 42 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Which of these pieces of code would return the name "Harry" from the following list?nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"] A) NameList(). B) NameList[1]. C) NameList(4). D) NameList["4"]. Show Answer Correct Answer: B) NameList[1]. 2. What does an if statement do? A) Close the program. B) Ask a question. C) Make a decision. D) Write a comment. Show Answer Correct Answer: C) Make a decision. 3. An ordered set of instructions to be executed by a computer to carry out a specific task is called ..... A) None of the above. B) Pseudocode. C) Algorithm. D) Program. Show Answer Correct Answer: D) Program. 4. Which statement about variable naming is correct? A) Variable can start with a number. B) Variable can start with an underscore. C) Variable can include # and *. D) Variable can include spaces. Show Answer Correct Answer: B) Variable can start with an underscore. 5. How do you close the file? A) MyFile = close(). B) MyFile.close. C) Close = MyFile(). D) MyFile.close(). Show Answer Correct Answer: D) MyFile.close(). 6. Explain the concept of operator precedence in Python. A) Operator precedence in Python dictates the order of operations in expressions, with higher precedence operators evaluated first. B) All operators in Python have the same precedence level. C) Operator precedence only applies to arithmetic operations in Python. D) Operator precedence in Python is irrelevant to expression evaluation. Show Answer Correct Answer: A) Operator precedence in Python dictates the order of operations in expressions, with higher precedence operators evaluated first. 7. What will be the output of the following code? "'pythonname = "Sam"print("Hello, '' + name) "' A) Hello, Sam. B) Hello, name. C) Sam, Hello. D) Error. Show Answer Correct Answer: A) Hello, Sam. 8. Which of the following function can be used to find the data type of a variable? A) Data(). B) Type(). C) True(). D) Str(). Show Answer Correct Answer: B) Type(). 9. How do you import a module in Python? A) Load module name. B) Import module name. C) Include module name. D) Require module name. Show Answer Correct Answer: B) Import module name. 10. Which of the following is a high-level programming language? A) Assembly. B) Python. C) Machine Code. D) Binary. Show Answer Correct Answer: B) Python. 11. Which string subprogram is used to replace all occurrences of a certain string within another string? A) .split(). B) .strip(). C) .replace(, ). D) .index(). Show Answer Correct Answer: C) .replace(, ). 12. What will be the data type of x after the following statement if input entered is 18? x = input('Enter a number:') A) Float. B) String. C) Integer. D) List. Show Answer Correct Answer: B) String. 13. What is the correct syntax for assigning the value 10 to a variable named x in Python? A) X:= 10. B) X = 10. C) Let x = 10. D) X == 10. Show Answer Correct Answer: B) X = 10. 14. Python programming use COMPILER to translate the source code A) TRUE. B) FALSE. C) All the above. D) None of the above. Show Answer Correct Answer: B) FALSE. 15. Which symbol represents multiplication? A) *. B) /. C) +. D) **. Show Answer Correct Answer: A) *. 16. Which of the following is a valid variable name? A) Var1. B) Var!. C) Var-name. D) 1var. Show Answer Correct Answer: A) Var1. 17. Which of the following is the correct syntax for a for loop in Python? A) For i in range(5):print(i). B) For (i = 0; i < 5; i++):print(i). C) Foreach i in range(5):print(i). D) For i = 0 to 5:print(i). Show Answer Correct Answer: A) For i in range(5):print(i). 18. What is a commenting line? A) It is where you comment on something. B) A line which is strait. C) Commenting line helps the reader to understand the code for future purposes. D) None of these. Show Answer Correct Answer: C) Commenting line helps the reader to understand the code for future purposes. 19. What will be the output of the following code?x = 2y = 3print(x)x = x + yprint(x) A) 2. B) 5. C) 25. D) 23. E) It will produce an error. Show Answer Correct Answer: C) 25. 20. In programming, a (n) ..... is a value that can change, depending on conditions or on information passed to the program A) String. B) Block. C) Instruction. D) Variable. Show Answer Correct Answer: D) Variable. 21. What is the output for ' ' in 'python'? A) True. B) False. C) Error. D) For loop runs perfectly. Show Answer Correct Answer: B) False. 22. Both the print statement will return same output (T/F) A) Not applicable. B) Depends on the context. C) True. D) False. Show Answer Correct Answer: C) True. 23. What does PLS use for the conversion between data types? A) Conversion functions like int(), str(), float(), bool(), or list(). B) Automatic type casting without any functions. C) Only casting operators like (int), (str), (float). D) Conversion is not possible in PLS. Show Answer Correct Answer: A) Conversion functions like int(), str(), float(), bool(), or list(). 24. Which of the following is the correct way to write a multi-line comment in Python? A) /* This is a comment */. B) // This is a comment. C) """This is a comment""". D) None of the above. Show Answer Correct Answer: C) """This is a comment""". 25. What is the first step to start a new program in Python? A) Select File > Open. B) Select File > New File. C) Select File > Save As. D) Select File > Close. Show Answer Correct Answer: B) Select File > New File. ← PreviousNext →Related QuizzesClass 11 Computer Science Chapter 2 Introduction To Python Quiz 1Class 11 Computer Science Chapter 2 Introduction To Python Quiz 2Class 11 Computer Science Chapter 2 Introduction To Python Quiz 3Class 11 Computer Science Chapter 2 Introduction To Python Quiz 4Class 11 Computer Science Chapter 2 Introduction To Python Quiz 5Class 11 Computer Science Chapter 2 Introduction To Python Quiz 6Class 11 Computer Science Chapter 2 Introduction To Python Quiz 7Class 11 Computer Science Chapter 2 Introduction To Python Quiz 8Class 11 Computer Science Chapter 2 Introduction To Python Quiz 9Class 11 Computer Science Chapter 2 Introduction To Python Quiz 10 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books