This quiz works best with JavaScript enabled. Home > Cbse > Class 11 > Science > Computer Science > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 16 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 16 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Define the term syntax error A) The rule of language. B) English. C) All the above. D) None of the above. Show Answer Correct Answer: A) The rule of language. 2. Which data type represents a whole number? A) Float. B) Boolean. C) Integer. D) String. Show Answer Correct Answer: C) Integer. 3. Operator aritmatika apa yang digunakan untuk melakukan perkalian dalam Python? A) -. B) +. C) /. D) *. Show Answer Correct Answer: D) *. 4. A syntax error in your code means: A) You have not used enough characters. B) There was no defined index. C) Python can't find a file to pass the code to. D) There is an error with your typing and code structure. Show Answer Correct Answer: D) There is an error with your typing and code structure. 5. Which career involves using Python to analyze and visualize data? A) Hairdresser. B) Data analyst. C) Florist. D) Librarian. Show Answer Correct Answer: B) Data analyst. 6. What type of data is the following?:X = "195.67" A) Float. B) Integer. C) Boolean. D) String. Show Answer Correct Answer: D) String. 7. What is the purpose of variables in Python? A) To store data. B) To run programs. C) To create functions. D) To print output. Show Answer Correct Answer: A) To store data. 8. A ..... is set of instructions that is given to a computer to perform a task. A) Identifier. B) Variable. C) Program. D) Data. Show Answer Correct Answer: C) Program. 9. What does the 'count()' method do in a Pandas Series? A) Returns the number of non-NaN values in the Series. B) Returns the first element of the Series. C) Returns the total number of elements in the Series. D) Returns the number of NaN values in the Series. Show Answer Correct Answer: A) Returns the number of non-NaN values in the Series. 10. On which operating system can you use Python? A) Mac OS. B) Windows. C) Linux. D) All of these are true. Show Answer Correct Answer: D) All of these are true. 11. The letter 'U' is which data type? A) Integer. B) Real/Decimal/Float. C) Boolean. D) Char. E) String. Show Answer Correct Answer: D) Char. 12. How do you keep track of different versions of your code? A) Version control. B) Python. C) Essential coding. D) 3%. Show Answer Correct Answer: A) Version control. 13. Tuples are ..... A) Mutable. B) Immutable. C) Both Mutable and Immutable. D) Allow modifications. Show Answer Correct Answer: B) Immutable. 14. Which control structure is used to repeat a block of code a certain number of times? A) Print. B) If. C) Def. D) For. Show Answer Correct Answer: D) For. 15. What is the result of the following code? "'pythonname = "Bob"print(name.upper()) "' A) BOB. B) Bob. C) Bob. D) Error. Show Answer Correct Answer: A) BOB. 16. What is the word used to display numbers and text on the screen? A) Input. B) Output. C) Print. D) Command. Show Answer Correct Answer: C) Print. 17. What is the order in which a computer solves a problem? A) Process, Output, Input. B) Input, Process, Output. C) Output, Process, Input. D) Process, Input, Output. Show Answer Correct Answer: B) Input, Process, Output. 18. What will the following code print? "'pythonx = 5if x > 3:print("Hello")else:print("Goodbye") "' A) Goodbye. B) Error. C) Nothing. D) Hello. Show Answer Correct Answer: D) Hello. 19. What is the purpose of Anaconda? A) Machine learning only. B) Data science and machine learning. C) Web development. D) Game development. Show Answer Correct Answer: B) Data science and machine learning. 20. Which of the following is a correct way to print a message in Python? A) 'echo "Hello"'. B) 'printf("Hello")'. C) 'write("Hello")'. D) 'print("Hello")'. Show Answer Correct Answer: D) 'print("Hello")'. 21. The instructions in an algorithm, when expressed precisely in English, ..... A) Can only be carried out by humans. B) Can only be carried out by computers. C) Can be carried out by both humans and computers. D) None of the above. Show Answer Correct Answer: A) Can only be carried out by humans. 22. Which of these will show an error in Python? A) Print(5 + 2). B) Print("Wow!"). C) Print(Hello). D) Print(4 * 3). Show Answer Correct Answer: C) Print(Hello). 23. Which operation is possible with tuples but not with lists in Python? A) Using as dictionary keys. B) Extending with another sequence. C) Sorting in place. D) Appending elements. Show Answer Correct Answer: A) Using as dictionary keys. 24. Koju funkciju koristiti za unos u Pythonu? A) Koristite funkciju 'input()'. B) Koristite funkciju 'read()'. C) Koristite funkciju 'scan()'. D) Koristite funkciju 'get()'. Show Answer Correct Answer: A) Koristite funkciju 'input()'. 25. Which of the following is NOT allowed in Python variable names? A) Lowercase letters. B) Spaces. C) Underscore ( ). D) Digits (after the first character). Show Answer Correct Answer: B) Spaces. 26. What is the correct way to define a function in Python? A) Define greet():. B) Def greet():. C) Function greet():. D) Create greet():. Show Answer Correct Answer: B) Def greet():. 27. Which keyword is used to define a function in Python? A) Define. B) Def. C) Function. D) Method. Show Answer Correct Answer: B) Def. 28. Which data type is used to store:100 A) Boolean. B) Integer. C) Double. D) String. Show Answer Correct Answer: B) Integer. 29. How do you start a comment in Python? A) . B) /*. C) //. D) #. Show Answer Correct Answer: D) #. 30. What is the code for a STRING in python? A) Str. B) Stri. C) Stg. D) None of the above. Show Answer Correct Answer: A) Str. 31. Which of the following is used to check multiple conditions in Python? A) If else. B) For. C) If elif else. D) Def. Show Answer Correct Answer: C) If elif else. 32. What symbol is used in python to assign values to a variable? A) Asterisk *. B) Equals =. C) Forward slash /. D) Plus +. Show Answer Correct Answer: B) Equals =. 33. What will the following code output:for i in range(3):print(i)? A) 1, 2, 3. B) 012. C) 0, 1, 2. D) -1, 0, 1. Show Answer Correct Answer: B) 012. 34. Is the input command predefined in Python? A) No. B) Yes. C) Not sure. D) Its not predefined. Show Answer Correct Answer: B) Yes. 35. Which loop repeats a block of code while a condition is true? A) Loop. B) While. C) Repeat. D) For. Show Answer Correct Answer: B) While. 36. What will the following code output? print(5 == 5) A) True. B) False. C) None. D) Error. Show Answer Correct Answer: A) True. 37. Which Python command is used to output information to the screen? A) Output. B) Read. C) Print. D) Display. Show Answer Correct Answer: C) Print. 38. What is the default path where Python looks for modules? A) The directory where the script is located. B) The system's library directory. C) The Python installation directory. D) The current working directory. Show Answer Correct Answer: A) The directory where the script is located. 39. Which of the following statements is true about local and global variables in Python functions? A) Local variables can be accessed outside the function where they are defined. B) Global variables can be accessed only inside the function where they are defined. C) Local variables exist only within the function and cannot be accessed outside it. D) Global variables cannot be accessed by functions. Show Answer Correct Answer: C) Local variables exist only within the function and cannot be accessed outside it. 40. What types of data does Python support? A) Int, float, Boolean, string, and list. B) Only integers and strings. C) Only lists and dictionaries. D) None of the above. Show Answer Correct Answer: A) Int, float, Boolean, string, and list. 41. Which algorithm would be the most efficient algorithm for finding a name in a phone book? A) Flipping through the book two pages at a time. B) Starting from the first page and looking for a name one page at a time. C) Opening the phone book to the middle and dividing the problem in half each time. D) Opening the phone book to a random page and searching from there. Show Answer Correct Answer: C) Opening the phone book to the middle and dividing the problem in half each time. 42. Why did Python's creator name the language after Monty Python's Flying Circus? A) Because it's a widely-used language. B) Due to its association with large snakes. C) In honor of the TV show. D) As a tribute to Hollywood Bowl. Show Answer Correct Answer: C) In honor of the TV show. 43. What does the subprogram 'chr' do in PLS? A) Displays the content of prompt to the screen. B) Returns the string which matches the Unicode value of. C) Returns the length of the object. D) Rounds a number to a specified number of digits. Show Answer Correct Answer: B) Returns the string which matches the Unicode value of. 44. What is the main characteristic of PyPy? A) It is an implementation optimized for microcontrollers. B) It translates Python code into C code for execution. C) It is a Python version written in RPython. D) It is a Python version written in Java. Show Answer Correct Answer: B) It translates Python code into C code for execution. 45. Write the output of the following code:x = 4-7j; print(x.imag, x.real) A) 4.0-7.0. B) -7.0 4.0. C) Error. D) None of the above. Show Answer Correct Answer: B) -7.0 4.0. 46. What will this display?age = 10print(age + 5) A) 15. B) Error. C) 105. D) Age + 5. Show Answer Correct Answer: A) 15. 47. What is the primary purpose of a programming language? A) To design computer hardware. B) To write and execute human languages. C) To give instructions to a computer. D) To browse the internet. Show Answer Correct Answer: C) To give instructions to a computer. 48. How do you insert COMMENTS in Python code? 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. 49. What Python command lets the user enter an answer to a question? A) Print(). B) Input(). C) Answer(). D) Open(). Show Answer Correct Answer: B) Input(). 50. Python is an example of: A) Assembly Language. B) High-Level Programming Language. C) Machine Language. D) Procedural Programming Language. Show Answer Correct Answer: B) High-Level Programming Language. 51. What are the three important data structures in Pandas? A) Series, DataFrame, and Panel. B) Array, List, and Dictionary. C) Matrix, DataFrame, and Series. D) Table, Chart, and Graph. Show Answer Correct Answer: A) Series, DataFrame, and Panel. 52. What is the purpose of using functions in Python? A) To execute a specific task in the program. B) To do a specific job. C) To organize and store files. D) To enhance the performance of the program. Show Answer Correct Answer: B) To do a specific job. 53. What is a common problem that can occur with recursive functions? A) Infinite recursion. B) Complex syntax. C) Lack of flexibility. D) Slow performance. Show Answer Correct Answer: A) Infinite recursion. 54. What programme do we use? A) POWERPOINT. B) IDLE. C) INTERNET. D) WORD. Show Answer Correct Answer: B) IDLE. 55. What keyword is used in Python to handle exceptions? A) Catch. B) Handle. C) Check. D) Try. Show Answer Correct Answer: D) Try. 56. High-level languages were developed because: A) Computers couldn't understand machine language. B) Machine language was too fast. C) Machine language was difficult for average programmers to understand. D) High-level languages are more efficient. Show Answer Correct Answer: C) Machine language was difficult for average programmers to understand. 57. What will be the result of the following expression?not (5 > 3) A) False. B) True. C) 5. D) Error. Show Answer Correct Answer: A) False. 58. What type of number is 'height = 5.8'? A) Float. B) Integer. C) String. D) None of the above. Show Answer Correct Answer: A) Float. 59. What is the correct way to start a comment in Python? A) **. B) //. C) #. D) . Show Answer Correct Answer: C) #. 60. What is the output of print(10 == 10)? A) 10. B) True. C) None. D) True and False. E) False. Show Answer Correct Answer: B) True. ← 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