This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 76 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 76 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. How to call a method? A) Obj.method. B) Obj.method(). C) Method(object). D) Method.object. Show Answer Correct Answer: B) Obj.method(). 2. What is one of the objectives of the 'Introduction to Python Programming' course? A) Learn the syntax and semantics of the Python programming language. B) Learn Java programming. C) Study web development. D) Learn about databases. Show Answer Correct Answer: A) Learn the syntax and semantics of the Python programming language. 3. What is the correct way to declare a list in Python? A) List = \{1, 2, 3\}. B) List = <1, 2, 3>. C) List = (1, 2, 3). D) List = [1, 2, 3]. Show Answer Correct Answer: D) List = [1, 2, 3]. 4. Data Science bertanggung jawab untuk ..... A) Menghapus data yang tidak diperlukan. B) Mengumpul, mengolah, & menganalisis data. C) Menyimpan data dalam cloud. D) Membuat tampilan aplikasi. Show Answer Correct Answer: B) Mengumpul, mengolah, & menganalisis data. 5. Which of the following is the correct way to implement a function named DivExp that takes two parameters a and b, returns c=a/b, asserts a>0, and raises an exception when b=0? A) Def DivExp(a, b):assert a > 0; if b == 0:raise Exception('Division by zero'); return a / b. B) Def DivExp(a, b):if a < 0:raise Exception('a must be positive'); return a / b. C) Def DivExp(a, b):assert b > 0; return a / b. D) Def DivExp(a, b):if b == 0:return 0; return a / b. Show Answer Correct Answer: A) Def DivExp(a, b):assert a > 0; if b == 0:raise Exception('Division by zero'); return a / b. 6. What data type is used for decimal numbers in Python? A) Integer. B) Boolean. C) Float or Decimal. D) String. Show Answer Correct Answer: C) Float or Decimal. 7. Which of the following is an exponent operator? A) **. B) /. C) //. D) *. Show Answer Correct Answer: A) **. 8. What should you do to keep a running total of numbers in a for loop? A) Define it for the first time before the for loop starts. B) Redefine it as itself plus some operation in the body of the for loop. C) Both of the above. D) None of the above. Show Answer Correct Answer: C) Both of the above. 9. How many pixels does Tracy move forward before drawing another circle? A) 25. B) 20. C) 15. D) 35. Show Answer Correct Answer: B) 20. 10. Which function shows the largest value? A) Max(). B) Min(). C) Big(). D) High(). Show Answer Correct Answer: A) Max(). 11. Python can be used to build A) Website. B) ERP. C) ANDROID APPS. D) ALL OF THE ABOVE. Show Answer Correct Answer: D) ALL OF THE ABOVE. 12. What if the colour entered is NOT red?colour = input( "Enter the trafficlight colour" )if colour == "Red" :print "Stop" else:print "Go" A) Stop appears on screen. B) Go appears on screen. C) Get Ready appears on screen. D) None of the above. Show Answer Correct Answer: B) Go appears on screen. 13. What is the purpose of the command "import turtle" in Python? A) To draw a turtle on the screen. B) To exit the Python environment. C) To make the "turtle" library's functions and commands available for use in your code. D) To create a new Python file. Show Answer Correct Answer: C) To make the "turtle" library's functions and commands available for use in your code. 14. What will be the output of the following code?num1 = "30"num2 = "80"print(num1 + num2) A) 30 + 80. B) 3080. C) 110. D) It will produce an error. Show Answer Correct Answer: B) 3080. 15. The term which describes the rules that govern a computer language, how it is structured and written. A) Syntax. B) Syntax error. C) Logic error. D) Bug. E) Debug. Show Answer Correct Answer: A) Syntax. 16. Which keyword is used to create a function in Python? A) Def. B) Func. C) Function. D) Make. Show Answer Correct Answer: A) Def. 17. What are comments in Python? A) Notes ignored by the computer. B) Errors in the code. C) Variables that store values. D) None of the above. Show Answer Correct Answer: A) Notes ignored by the computer. 18. What will the following code print?for i in range(3):if i == 1:continueprint(i) A) 0 1 2. B) 0 2. C) 1 2. D) 0 2 3. Show Answer Correct Answer: B) 0 2. 19. Which of the following is used to get the remainder of a division in Python? A) /. B) //. C) %. D) **. Show Answer Correct Answer: C) %. 20. How do you write an else statement in Python? A) If:. B) Elseif:. C) Else:. D) Else if:. Show Answer Correct Answer: C) Else:. 21. What is the purpose of the 'pass' statement in Python? A) The 'pass' statement serves as a placeholder that does nothing. B) The 'pass' statement is a way to comment code. C) The 'pass' statement raises an exception. D) The 'pass' statement is used to define a function. Show Answer Correct Answer: A) The 'pass' statement serves as a placeholder that does nothing. 22. Which value is a Float data type? A) 64. B) "cat". C) True. D) 0.5. Show Answer Correct Answer: D) 0.5. 23. What is the purpose of the 'pendown()' subprogram in the turtle library? A) Sets the color of the pen. B) Puts the pen down. C) Changes the pen size. D) Lifts the pen up. Show Answer Correct Answer: B) Puts the pen down. 24. What will the following code print? "'pythonx = 4if x > 2:print("A")else:print("B") "' A) A. B) B. C) AB. D) Nothing. Show Answer Correct Answer: A) A. 25. Kako se deklarira varijabla u Pythonu? A) Vrijednost = ime varijable. B) Ime varijable = vrijednost. C) Ime varijable:vrijednost. D) Deklariraj ime varijable kao vrijednost. Show Answer Correct Answer: B) Ime varijable = vrijednost. ← 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