This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 66 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 66 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Which one is NOT a legal variable name? A) My var. B) Myvar. C) Myvar. D) My-var. Show Answer Correct Answer: D) My-var. 2. What is the output of the following code snippet? "'pythonx = 5y = 10print(x + y) "' A) 15. B) 510. C) 5. D) 10. Show Answer Correct Answer: A) 15. 3. What will be the output of the following code? print("The length is", 5, "metres") A) The length is 5metres. B) The length is 5 metres. C) The length is 5, metres. D) The length is 5. Show Answer Correct Answer: B) The length is 5 metres. 4. Which of the following is an immutable data type? A) List. B) Set. C) Dictionary. D) Tuple. Show Answer Correct Answer: D) Tuple. 5. What is the output of the following code? 'print("The result is '' + str(5 + 3))' A) The result is 8. B) The result is 5 + 3. C) The result is 53. D) Error. Show Answer Correct Answer: A) The result is 8. 6. Who is the creator of the Python programming language? A) Wally Feurzeig. B) Seymour Papert. C) Guido Van Rossam. D) Cynthia Solomon. Show Answer Correct Answer: C) Guido Van Rossam. 7. 42 is an example of what data type? A) Integer. B) Float. C) Boolean. D) None of the above. Show Answer Correct Answer: A) Integer. 8. What is wrong with the following function?def add (x, y):return x + zprint (add (3, 4) ) A) Add function should return z. B) Add function should not have parameters. C) Z is not defined. D) No errors. Show Answer Correct Answer: C) Z is not defined. 9. What will the following code print? "'pythonx = 10if x > 5:print("Greater")else:print("Smaller") "' A) Greater. B) Smaller. C) Error. D) Nothing. Show Answer Correct Answer: A) Greater. 10. What will be the output of the following code?x = 10if x > 5:print("x is greater than 5")else:print("x is 5 or less") A) X is greater than 5. B) X is 5 or less. C) X is equal to 5. D) No output. Show Answer Correct Answer: A) X is greater than 5. 11. What is the output of the following python code:tup1=(10, 20, 40, 60, 70)print(tup1[4:2]) A) Blank output ( ). B) (70, 60, 40). C) (70, 60, 40, 20). D) Error. Show Answer Correct Answer: A) Blank output ( ). 12. What kind of program does Python need? A) Interpreter. B) Compiler. C) Assembler. D) Machine code. Show Answer Correct Answer: A) Interpreter. 13. Which operator is used to reverse the logical state of its operand? A) ~. B) !. C) -. D) Not. Show Answer Correct Answer: D) Not. 14. Which statement best describes tuple immutability? A) Items are permanently fixed after creation. B) Elements can be updated in place. C) Order is unpredictable during runtime. D) You can freely append new values. Show Answer Correct Answer: A) Items are permanently fixed after creation. 15. Which of the following is not in Python Character Set? A) Images:Vector. B) Whitespaces:blank space, tab etc. C) Digits:0-9. D) Letters:A-Z or a-z. Show Answer Correct Answer: A) Images:Vector. 16. To add an item to the end of a list we can use which method? A) Add(). B) End(). C) Remove(). D) Append(). Show Answer Correct Answer: D) Append(). 17. Which of the following is a valid Python identifier? A) My-name. B) 2name. C) Myname. D) None of the above. Show Answer Correct Answer: C) Myname. 18. What does the 'round' subprogram in PLS do? A) Returns the string which matches the Unicode value of. B) Displays the content of prompt to the screen. C) Returns the length of the object. D) Rounds to the number of digits after the decimal. Show Answer Correct Answer: D) Rounds to the number of digits after the decimal. 19. How can you read a file in Python? A) Use 'open(filename) as file:content = file.read()' to read a file in Python. B) Employ 'with open(filename, 'w') as file:file.write(data)' to read a file in Python. C) Use 'with open(filename, 'r') as file:content = file.read()' to read a file in Python. D) Utilize 'open(filename, 'rb') as file:content = file.read()' to read a file in Python. Show Answer Correct Answer: C) Use 'with open(filename, 'r') as file:content = file.read()' to read a file in Python. 20. What is the name of this program? A) Data Control with Python. B) Data Analysis with Python. C) Python with Big Data. D) Data Analysis with Pandas. Show Answer Correct Answer: B) Data Analysis with Python. 21. What will be the output of the following code? "'pythonx = 5y = 10print(x + y) "' A) '15'. B) '510'. C) '5 + 10'. D) 'Error'. Show Answer Correct Answer: A) '15'. 22. What does this function do? input() A) Opens the CD tray. B) Asks the user to type something in. C) Displays the word 'input'. D) Exits the program. Show Answer Correct Answer: B) Asks the user to type something in. 23. What is operator precedence and how does it affect expressions in Python? A) Operator precedence determines the data types used in expressions. B) Operator precedence affects the evaluation order of operators in expressions, influencing the final result. C) Operator precedence is only relevant for arithmetic operations. D) Operator precedence has no impact on the execution of Python programs. Show Answer Correct Answer: B) Operator precedence affects the evaluation order of operators in expressions, influencing the final result. 24. You have a tuple temperatures = (12, 18, 5, 20). Which call finds the smallest temperature? A) Max(temperatures) finds the smallest. B) Len(temperatures) finds the smallest. C) Min(temperatures) finds the smallest. D) Sum(temperatures) finds the smallest. Show Answer Correct Answer: C) Min(temperatures) finds the smallest. 25. What is the command to create a DataFrame from a list of dictionaries? A) Pd.DataFrame(list of dicts). B) Pd.createDataFrame(list of dicts). C) Pd.DataFrame.from dict(list of dicts). D) Pd.DataFrameBuilder(list of dicts). Show Answer Correct Answer: A) Pd.DataFrame(list of dicts). ← 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