This quiz works best with JavaScript enabled. Home > Cbse > Class 11 > Science > Computer Science > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 18 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 18 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What will be the output of the following Python code?d = {"john":40, "peter":45}d["john"] A) 40. B) "peter". C) 45. D) "john". Show Answer Correct Answer: A) 40. 2. What is the purpose of the 'type' function in Python? A) To assign datatype. B) To create a variable. C) To convert data types. D) To check the data type. Show Answer Correct Answer: D) To check the data type. 3. What command do we use to tell Python to accept an input? A) Cin. B) Scanf(). C) <>. D) Input(). Show Answer Correct Answer: D) Input(). 4. Which programming language would a professional programmer be most likely to use in their jobs? A) Python. B) Scratch. C) All the above. D) None of the above. Show Answer Correct Answer: A) Python. 5. Which of the following is a method to remove an element from a dictionary in Python? A) Delete(). B) Pop(). C) Discard(). D) Remove(). Show Answer Correct Answer: B) Pop(). 6. Which one is a string in Python? A) "Hello". B) Hello. C) 123. D) 3+4. Show Answer Correct Answer: A) "Hello". 7. What is a logic error? A) An error that causes a program to crash. B) An error in the data type. C) An error in the rules of the language. D) An error in the logic of the program. Show Answer Correct Answer: D) An error in the logic of the program. 8. What is the output of print("Python is fun")? A) Print(Python is fun). B) Python is fun. C) "Python is fun". D) Nothing. Show Answer Correct Answer: B) Python is fun. 9. What is a punctuator? A) Punctuation marks. B) Punctuators help complete a SYNTAX. C) A symbol. D) All of the above. Show Answer Correct Answer: B) Punctuators help complete a SYNTAX. 10. What will this program do?print("Hello world") A) Error. B) Output Hello world. C) Output "Hello world". D) Output print. Show Answer Correct Answer: B) Output Hello world. 11. Who developed the Python language? A) Guido van Rossum. B) Wick van Rossum. C) Zim Den. D) Niene Stom. Show Answer Correct Answer: A) Guido van Rossum. 12. Operators of same precedence are executed from ..... A) Left to right. B) Right to left. C) In any order. D) None of the above. Show Answer Correct Answer: A) Left to right. 13. Which symbol is used for 'not equal to' in Python? A) ><. B) =!. C) !=. D) <>. Show Answer Correct Answer: C) !=. 14. What is the default return type of the input() function? A) Int. B) Float. C) Str. D) Bool. Show Answer Correct Answer: C) Str. 15. How do you correctly name the rules of a programming language? A) Syntax. B) Grammar. C) Code. D) None of these are true. Show Answer Correct Answer: A) Syntax. 16. What is the purpose of 'else' in an 'if-else' statement? A) It checks another condition if the first is True. B) It repeats the 'if' block twice. C) It ends the program immediately. D) It runs when the 'if' condition is False. Show Answer Correct Answer: D) It runs when the 'if' condition is False. 17. Which of these is used to repeat actions? A) Print. B) Loop. C) While. D) If. Show Answer Correct Answer: B) Loop. 18. Which of the following statements will display the temperature in Celsius entered by the user? A) Print("Temperature in Celsius is '' + str(input())). B) Print("Temperature in Celsius is", input()). C) Print("Temperature in Celsius is '' + input()). D) Print("Temperature in Celsius is", int(input())). Show Answer Correct Answer: B) Print("Temperature in Celsius is", input()). 19. In programming, a LIBRARY is a set of important functions and methods that you can access to make your programming easier A) False. B) True. C) All the above. D) None of the above. Show Answer Correct Answer: B) True. 20. In which situation would you prefer recursion over iteration? A) When the problem involves a fixed number of iterations. B) When you need the highest performance possible. C) When the problem is too simple for recursion. D) When the problem can be divided into smaller sub-problems that are similar to the original problem. Show Answer Correct Answer: D) When the problem can be divided into smaller sub-problems that are similar to the original problem. 21. A=1a, b=a+1, a+1print(a, b)a, b=a+2, a+3print(a, b) A) 2 34 5. B) 2 25 5. C) 2 24 5. D) 2 25 4. Show Answer Correct Answer: C) 2 24 5. 22. High and low-level programming languages can be understood by a computer. A) False. B) True. C) All the above. D) None of the above. Show Answer Correct Answer: A) False. 23. A testing environment that users can test code, run programs or files without impacting the system, application, or machine used. A) Interactive mode. B) Script mode. C) Sandbox. D) Interpreter. Show Answer Correct Answer: C) Sandbox. 24. What should you do every time you make a change to your Python program? A) Save the program. B) Restart the computer. C) Close the program. D) Delete the program. Show Answer Correct Answer: A) Save the program. 25. Which of the following is used to display output in Python? A) Echo( ). B) Display( ). C) Write( ). D) Print( ). Show Answer Correct Answer: D) Print( ). 26. What will be printed by the following code? "'pythonx = 5y = "5"print(x + int(y)) "' A) 55. B) 5. C) 10. D) Error. Show Answer Correct Answer: C) 10. 27. What data type is used to represent true or false values in Python? A) Boolean. B) Float. C) Integer. D) String. Show Answer Correct Answer: A) Boolean. 28. Which function is used to get input from the user in Python? A) Read(). B) Get(). C) Input(). D) Scan(). Show Answer Correct Answer: C) Input(). 29. Python was named after the British television show, ..... A) Monty Circus Python's Flying. B) Monty Python's Circus Flying. C) Monty Flying Circus Python's. D) Monty Python's Flying Circus. Show Answer Correct Answer: D) Monty Python's Flying Circus. 30. Which of these is correct in Python? A) Print Hello. B) Print("Hello"). C) Print(Hello). D) Print("Hello"). Show Answer Correct Answer: B) Print("Hello"). 31. What is the radius of the circles used to draw a slinky? A) 20. B) 35. C) 30. D) 25. Show Answer Correct Answer: B) 35. 32. If you have a syntax error will the code run? A) Yes. B) No. C) All the above. D) None of the above. Show Answer Correct Answer: B) No. 33. What is the purpose of the 'input()' function in Python? A) To display output. B) To convert data types. C) To read files. D) To take user input. Show Answer Correct Answer: D) To take user input. 34. What is the purpose of the 'break' statement in a loop? A) To skip the current iteration of the loop. B) To pause the loop for a specified time. C) To exit a loop prematurely. D) To continue the loop indefinitely. Show Answer Correct Answer: C) To exit a loop prematurely. 35. How do you start a function in Python? A) Create. B) Start. C) Def. D) Function. Show Answer Correct Answer: C) Def. 36. What is the output of print('I will become a Python Pro')? A) I will become a Python Pro. B) I will become a Pro. C) I will become a Python. D) None of the above. Show Answer Correct Answer: A) I will become a Python Pro. 37. What is the mode available in Python? A) Script mode. B) Compilation mode. C) Safe mode. D) Attractive mode. Show Answer Correct Answer: A) Script mode. 38. How to insert elements at the last in list? A) A.append(90). B) A = [90]. C) A[-1] = 90. D) A.pop(90). Show Answer Correct Answer: A) A.append(90). 39. Which statement about sequential condition checking is correct? A) Python checks top to bottom order. B) Python skips the first condition. C) Python randomly picks a branch. D) Python checks all conditions at once. Show Answer Correct Answer: A) Python checks top to bottom order. 40. What is a run time error? A) An error in the data type. B) An error that causes a program to crash. C) An error in the rules of the language. D) An error in the logic of the program. Show Answer Correct Answer: B) An error that causes a program to crash. 41. Why is indenting used? A) To make text bold. B) To group steps. C) To increase font size. D) To create bullet points. Show Answer Correct Answer: B) To group steps. 42. How many libraries are available for Python? A) Over 1 million libraries. B) Around 50, 000 libraries. C) Less than 100 libraries. D) Over 300, 000 libraries. Show Answer Correct Answer: D) Over 300, 000 libraries. 43. What is the type of []? A) Tuple. B) Dict. C) List. D) Set. Show Answer Correct Answer: C) List. 44. The function used to find the length of a string is: A) Count(). B) Length(). C) Size(). D) Len(). Show Answer Correct Answer: D) Len(). 45. What does the following loop do?for i in range(3):print(i) A) Prints 3. B) Prints 0, 1, 2. C) Prints 0, 1, 2, 3. D) Prints 1, 2, 3. Show Answer Correct Answer: B) Prints 0, 1, 2. 46. Which of the following statements will print "Hello, World!" to the console in Python? A) Printf("Hello, World!"). B) Echo "Hello, World!". C) Print("Hello, World!"). D) System.out.println("Hello, World!"). Show Answer Correct Answer: C) Print("Hello, World!"). 47. The process of linking one thing to another A) Concatenate. B) Algorithm. C) Function. D) Variable. Show Answer Correct Answer: A) Concatenate. 48. An application that contains all the necessary tools needed to write a program is called: A) Compiler. B) Text editor. C) Python shell. D) Integrated Development Environment (IDE). Show Answer Correct Answer: D) Integrated Development Environment (IDE). 49. How many tests are conducted for the theory component of the IC and what is the mark for each test? A) One test of 60 marks. B) Four tests, each of 15 marks. C) Two tests, each of 25 marks. D) Three tests, each of 20 marks. Show Answer Correct Answer: D) Three tests, each of 20 marks. 50. Which symbol is used for comments in Python? A) . B) /*. C) #. D) //. Show Answer Correct Answer: C) #. 51. The result of this code is print ("Welcome to programming") A) It will print this sentence in a paper. B) Welcome to programming. C) Error. D) None of the above. Show Answer Correct Answer: B) Welcome to programming. 52. The operators and, or, not are called A) Tooth operators. B) Boolean operators. C) Smooth operators. D) Truth operators. Show Answer Correct Answer: B) Boolean operators. 53. What is the output of 'series.head()' in Pandas? A) A summary of the series statistics. B) The entire series data. C) The first five members of the series. D) The last five members of the series. Show Answer Correct Answer: C) The first five members of the series. 54. What is the full form of IDLE A) INTEGARTED DEVELOPMENT AND LEARNING ENVIRONMENT. B) INTEGRATED DEVELOPING AND LEARN ERA. C) INTEGER DEVELOPMENT AND LOOP ENVIRONMENT. D) INTEGER DEVELOP AND LEARNING ENVIRONMENT. Show Answer Correct Answer: A) INTEGARTED DEVELOPMENT AND LEARNING ENVIRONMENT. 55. Which operator symbol is used for addition in Python? A) -. B) /. C) *. D) +. Show Answer Correct Answer: D) +. 56. What is the purpose of the 'else' statement in Python? A) To repeat a block of code. B) To execute a block of code when the 'if' condition is false. C) To define a variable. D) To handle errors. Show Answer Correct Answer: B) To execute a block of code when the 'if' condition is false. 57. What is the main advantage of Python being an interpreted language? A) It runs faster than compiled languages. B) It allows for cross-platform compatibility. C) You can execute code line by line and see the output immediately. D) It has built-in security features for network applications. Show Answer Correct Answer: C) You can execute code line by line and see the output immediately. 58. What does Python use to do math? A) Paint. B) Symbols like +, -, *, /. C) Notes. D) Pencils. Show Answer Correct Answer: B) Symbols like +, -, *, /. 59. Which operator is used for division in Python that returns a float? A) //. B) /. C) . D) %. Show Answer Correct Answer: B) /. 60. Select the correct flow of execution for the below program1. #program to add two numbers through a function2. def calc ..... Sum (x, y):3. s = x + y4. return s5.6. num1 = int (input ( "Enter first number:'' ) )7. num2 = int (input ( "Enter second number:'' ) )8. sum = calc ..... Sum (num1, num2)9. print ( "Sum of two given numbers is" , sum) A) 2-6-7-8-9-2-3-4. B) 2-6-7-8-2-3-4-8-9. C) 2-6-7-8-2-3-4. D) 2-6-7-8-2-3-4-9. Show Answer Correct Answer: D) 2-6-7-8-2-3-4-9. ← 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