This quiz works best with JavaScript enabled. Home > Cbse > Class 11 > Science > Computer Science > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 29 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 29 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Which of the following variable names is invalid? A) FirstName. B) Value1. C) User-name. D) Name 123. Show Answer Correct Answer: C) User-name. 2. The term which describes errors in a programme which are due to programmers making typing mistakes or spelling mistakes A) Syntax. B) Syntax error. C) Bug. D) Logic error. E) Debug. Show Answer Correct Answer: B) Syntax error. 3. What will print([1, 2, 3][0]) output? A) 0. B) 2. C) Error. D) 1. Show Answer Correct Answer: D) 1. 4. What is the output of print('Welcome to Python')? A) Welcome to Python. B) Welcome. C) Python. D) None of the above. Show Answer Correct Answer: A) Welcome to Python. 5. What is the purpose of the as keyword when importing a module? A) To copy the module. B) To create an alias for the module. C) To specify a function from the module. D) To include the module in the current script. Show Answer Correct Answer: B) To create an alias for the module. 6. What is the process of developing and implementing various sets of instructions to enable a computer to do a certain task? A) Computer Programming. B) Computer Servicing. C) Computer Processing. D) Computer Engineering. Show Answer Correct Answer: A) Computer Programming. 7. What will be the output of print("Python"[::-1])? A) Error. B) NohtyP. C) Pyt. D) Python. Show Answer Correct Answer: B) NohtyP. 8. Apa tujuan dari pernyataan 'if ..... name ..... == " ..... main ..... ":'? A) Untuk memungkinkan skrip dieksekusi di lingkungan mana pun. B) Untuk mencegah kesalahan sintaks dalam skrip. C) Untuk memastikan skrip berjalan lebih cepat saat dieksekusi. D) Untuk memungkinkan kode dijalankan hanya ketika skrip dieksekusi langsung, bukan saat diimpor. Show Answer Correct Answer: D) Untuk memungkinkan kode dijalankan hanya ketika skrip dieksekusi langsung, bukan saat diimpor. 9. What is the output of the following code?for i in range(3):if i == 2:breakprint(i) A) 0. B) 1, 2. C) 0, 1. D) 0, 1, 2. Show Answer Correct Answer: C) 0, 1. 10. The input() function in Python can be used to A) Let the user type in some text. B) Exit the program. C) Print text on the screen. D) Store a variable. Show Answer Correct Answer: A) Let the user type in some text. 11. An escape sequence represents how many characters?"t" A) 4. B) 1. C) 3. D) 2. Show Answer Correct Answer: B) 1. 12. What is the end after if statements? A) Else. B) Elif. C) While. D) If. Show Answer Correct Answer: A) Else. 13. What will the following code output?if 5 > 3:print("True")else:print("False") A) True. B) False. C) Error. D) None. Show Answer Correct Answer: A) True. 14. What is the function to exit the turtle graphics window? A) Turtle.quit(). B) Turtle.exit(). C) Turtle.close(). D) Turtle.done(). Show Answer Correct Answer: D) Turtle.done(). 15. Write the output of the following:print(range(0, 8, 2)) A) None of the above. B) Range(0, 8, 2). C) 0, 2, 4, 6. D) Error. Show Answer Correct Answer: B) Range(0, 8, 2). 16. Which of the following declarations is incorrect in python language? A) Xyzp = 5, 000, 000. B) X y z p = 5, 000, 000. C) X y z p = 5000 6000 7000 8000. D) X, y, z, p = 5000, 6000, 7000, 8000. Show Answer Correct Answer: C) X y z p = 5000 6000 7000 8000. 17. Which of the following is NOT a built in module in Python? A) Random module. B) Os module. C) Math module. D) Science module. Show Answer Correct Answer: D) Science module. 18. What is the output of the following code?for i in range(5):if i == 2:continueprint(i) A) 1, 3, 4. B) 0, 1, 2, 3, 4. C) 0, 1, 3, 4. D) 1, 2, 3, 4. Show Answer Correct Answer: C) 0, 1, 3, 4. 19. Which of the following is a valid tuple declaration? A) (1, 2, 3). B) {1, 2, 3}. C) [1, 2, 3]. D) <1, 2, 3>. Show Answer Correct Answer: A) (1, 2, 3). 20. What does len("Python") return? A) 6. B) Python. C) Error. D) 5. Show Answer Correct Answer: A) 6. 21. What will be the output of the following code? "'python# This is a commentprint(2 ** 3) "' A) 5. B) 6. C) 9. D) 8. Show Answer Correct Answer: D) 8. 22. What will be the output?name = 'Dave'greeting = "Good morning" + nameprint (greeting) A) Good morning + Dave. B) Good morning 'Dave'. C) Good morningDave. D) Good morning name. Show Answer Correct Answer: C) Good morningDave. 23. What character is used to indicate a comment in PLS? A) #. B) . C) %. D) //. Show Answer Correct Answer: A) #. 24. What will the below Python code will return?list1=[0, 2, 5, 1]str1="7"for i in list1:str1=str1+iprint(str1) A) Error. B) 70251. C) 7. D) 15. Show Answer Correct Answer: A) Error. 25. What is the output of the following code? "'pythonprint(type(3.14)) "' A) . B) . C) . D) . Show Answer Correct Answer: A) . 26. What is the main purpose of the Python Software Foundation? A) To promote the use of Python for commercial purposes. B) To promote the use of other programming languages. C) To oversee the development of Python. D) To provide financial support for Python developers. Show Answer Correct Answer: C) To oversee the development of Python. 27. What is the correct full form of IDLE in Python? A) Interactive Development and Language Environment. B) Integrated Development and Learning Environment. C) Integrated Development and Language Environment. D) Interactive Development and Learning Environment. Show Answer Correct Answer: B) Integrated Development and Learning Environment. 28. Python keywords are: A) Colors. B) Functions only. C) Any variable name. D) Reserved words. Show Answer Correct Answer: D) Reserved words. 29. Where to write explanatory text in Google Colab? A) Text Cell. B) Code Cell. C) All the above. D) None of the above. Show Answer Correct Answer: A) Text Cell. 30. Python files are saved with which extension? A) .exe. B) .py. C) .txt. D) .java. Show Answer Correct Answer: B) .py. 31. Which operator is used for concatenation in the slides? A) *. B) /. C) +. D) -. Show Answer Correct Answer: C) +. 32. A set of precise instructions that is meant to solve a problem is ..... A) A program. B) An algorithm. C) A computer. D) An interpreter. Show Answer Correct Answer: B) An algorithm. 33. What is the correct way to write a 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: A) # This is a comment. 34. What is the purpose of adding Python to PATH? A) To increase execution speed. B) To run Python from the command prompt. C) To install additional libraries. D) To enable debugging. Show Answer Correct Answer: B) To run Python from the command prompt. 35. What data type is used to represent whole numbers(eg . 11, 213, ) in Python? A) Int. B) String. C) Boolean. D) Float. Show Answer Correct Answer: A) Int. 36. What will the following code print? "'pythonx = 7if x > 5:if x < 10:print("A") else:print("B")else:print("C") "' A) B. B) A. C) Nothing. D) C. Show Answer Correct Answer: B) A. 37. Output of print(7 % 21) is ..... A) None of the above. B) 7. C) Error. D) 3. Show Answer Correct Answer: B) 7. 38. What is the command to verify if Python is installed successfully on your system? A) Python check. B) Python start. C) Python run. D) Python version. Show Answer Correct Answer: D) Python version. 39. ..... keyword is used for creating a function in Python. A) Define. B) Function. C) Def. D) Fun. Show Answer Correct Answer: C) Def. 40. Which step comes first in the Data Science process? A) Data collection. B) Deployment. C) Data visualization. D) Model building. Show Answer Correct Answer: A) Data collection. 41. Which command is used to install Jupyter Notebook using pip? A) Install jupyter. B) Pip install jupyter. C) Jupyter install. D) Python install jupyter. Show Answer Correct Answer: B) Pip install jupyter. 42. What is the result of the following operation in Python? print(15 // 4) A) 3. B) 4.0. C) 3.75. D) 4. Show Answer Correct Answer: A) 3. 43. What is the output of this code?def multiply (a, b = 2):return a * bprint (multiply (3, 4) ) A) 12. B) 6. C) Error. D) 8. Show Answer Correct Answer: A) 12. 44. What group of blocks controls movement of the Sprite? A) Control. B) Look. C) Sensing. D) Motion. Show Answer Correct Answer: D) Motion. 45. What is the purpose of the Python interpreter? A) Debug the source code. B) Compile the code into binary format. C) Convert source code into machine-executable code line by line. D) Optimize the program for speed. Show Answer Correct Answer: C) Convert source code into machine-executable code line by line. 46. Returning a range of characters (part of a string) is done using which syntax? A) Splice. B) Slice. C) Select. D) Cut. Show Answer Correct Answer: B) Slice. 47. What does the 'sorted()' function do in Python? A) Removes duplicates from a list. B) Sorts a list. C) Reverses a list. D) Creates a new list. Show Answer Correct Answer: B) Sorts a list. 48. What will the following code return? a='Hello World'print(a[0:8]) A) Hello Worl. B) Hello Wo. C) Hello W. D) Hello Wor. Show Answer Correct Answer: B) Hello Wo. 49. Koje su glavne vrste podataka u Pythonu? A) Float, string, niz. B) String, broj, objekt. C) Boolean, karakter, niz. D) Int, float, str, bool. Show Answer Correct Answer: D) Int, float, str, bool. 50. What language does Tracy the turtle understand? A) Swahili. B) Spanish. C) Python. D) English. Show Answer Correct Answer: C) Python. 51. X, y=20, 60y, x, y=x, y-10, x+10print (x, y) A) 50 30. B) 30 50. C) 60 10. D) 50 20. Show Answer Correct Answer: A) 50 30. 52. Convert the decimal number (345)10 to Octal: A) 431. B) 531. C) 331. D) 631. Show Answer Correct Answer: B) 531. 53. Is python case sensitive? A) Yes. B) No. C) All the above. D) None of the above. Show Answer Correct Answer: A) Yes. 54. Consider scores = (10, 15, 25). What is the result of sum(scores)? A) It returns 25 total. B) It returns 50 total. C) It returns 15 total. D) It returns 3 total. Show Answer Correct Answer: B) It returns 50 total. 55. In which year was Python officially made available to the public? A) 1991. B) 1919. C) 1998. D) 1989. Show Answer Correct Answer: A) 1991. 56. What will be the data type of y after the following statements?x = 48 y = str(x) A) String. B) Integer. C) Float. D) List. Show Answer Correct Answer: C) Float. 57. What does the range() function do in a for loop? A) Formats strings. B) Creates a list of numbers. C) Reads user input. D) Executes code indefinitely. Show Answer Correct Answer: B) Creates a list of numbers. 58. What exciting tool can Python create that we use on the internet? A) A pencil. B) A toy. C) A shoe. D) A website. Show Answer Correct Answer: D) A website. 59. What will the following code print? print('Hello, Universe!') A) Hello, Universe!. B) Hello, universe. C) Hello universe!. D) Hello, Universe!. Show Answer Correct Answer: A) Hello, Universe!. 60. Given t = ('x', 'y', 'z'), what does list(enumerate(t)) produce? A) Only values as strings. B) Value-index pairs as lists. C) Only indices as integers. D) Index-value pairs as tuples. Show Answer Correct Answer: D) Index-value pairs as tuples. ← PreviousNext →Related QuizzesScience QuizzesClass 11 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 8 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books