This quiz works best with JavaScript enabled. Home > Cbse > Class 11 > Science > Computer Science > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 23 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 23 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. When did its development begin? A) 1998. B) 1990. C) 1989. D) 2000. Show Answer Correct Answer: C) 1989. 2. Y = 4z = lambda x:x ** yprint z(3) A) 81. B) 12. C) 64. D) None of the above. Show Answer Correct Answer: A) 81. 3. What does a function do? A) Stores data. B) Saves files. C) Performs a task. D) Repeats actions. Show Answer Correct Answer: C) Performs a task. 4. What is the purpose of the 'def' keyword? A) To declare a variable in Python. B) To create a class in Python. C) To define a function in Python. D) To import a module in Python. Show Answer Correct Answer: C) To define a function in Python. 5. What will the following code output if the input is 13?lucky = 13print("Guess my number:")guess = int(input())if guess == lucky:print("Amazing, you guessed it")else:print("Sorry, it's not", guess) A) "Sorry, it's not 13". B) No output. C) "My lucky number is 13". D) "Amazing, you guessed it". Show Answer Correct Answer: D) "Amazing, you guessed it". 6. Out of addition(+) and Subtraction (-) operator, which has more precedence? A) Subtraction (-). B) Addition (+). C) None of the above. D) Both have same precedence. Show Answer Correct Answer: D) Both have same precedence. 7. Which of the following will cause an error in Python? A) Def func():. B) For i in range(5):. C) X = 5. D) Print("Hello). Show Answer Correct Answer: D) Print("Hello). 8. What does Find() do in Beautifulsoup. A) Return the requested element as a list from the HTML. B) Finds whether the element is present or not. C) Finds where the element is present. D) None of the above. Show Answer Correct Answer: A) Return the requested element as a list from the HTML. 9. What is the output of print(3.14 * 2) in Python? A) 6.28. B) 7.0. C) 6.0. D) 5.5. Show Answer Correct Answer: A) 6.28. 10. What do you use Python for? A) Drawing with crayons. B) Watching movies. C) Listening to music. D) Writing programs. Show Answer Correct Answer: D) Writing programs. 11. Which of the following will print the string '"The weight is 25 kgs"' using the variable 'weight = 25'? A) Print("The weight is {weight} kgs"). B) Print("The weight is '' + str(weight) + '' kgs"). C) Print("The weight is '' + weight + '' kgs"). D) Print(f"The weight is {weight} kgs"). Show Answer Correct Answer: D) Print(f"The weight is {weight} kgs"). 12. Which keyword is used to start an if statement? A) If. B) When. C) Else. D) For. Show Answer Correct Answer: A) If. 13. What is a dictionary in Python? A) A dictionary is a collection of ordered items in Python. B) A dictionary is a type of list in Python. C) A dictionary in Python is a collection of key-value pairs. D) A dictionary in Python is a single value. Show Answer Correct Answer: C) A dictionary in Python is a collection of key-value pairs. 14. What is the keyword used to define a function in Python? A) 'function'. B) 'def'. C) 'func'. D) 'define'. Show Answer Correct Answer: B) 'def'. 15. How do you remove the value '3' from a list called 'numbers'? A) Numbers.remove(3). B) Numbers.delete(3). C) Numbers.discard(3). D) Numbers.pop(3). Show Answer Correct Answer: A) Numbers.remove(3). 16. How do you take user input and store it in a variable called 'name' in Python 3? A) Name = raw input("Enter your name: "). B) Name = input("Enter your name: "). C) Name:= input("Enter your name: "). D) Input(name). Show Answer Correct Answer: B) Name = input("Enter your name: "). 17. What is the output of print(3 * 'Hi')? A) Hi. B) HiHiHi. C) Error. D) 3Hi. Show Answer Correct Answer: B) HiHiHi. 18. What is the output of the following code:print(f'7 x 3 = {7 * 3}')? A) 7 x 3 = 73. B) 7 x 3 = 21. C) 7 x 3 = 30. D) 7 x 3 = 10. Show Answer Correct Answer: B) 7 x 3 = 21. 19. What is the purpose of lesson closure in teaching? A) To summarize key points and reinforce learning. B) To introduce new topics. C) To assign homework. D) To end the class early. Show Answer Correct Answer: A) To summarize key points and reinforce learning. 20. What is automation? A) A process which occurs automatically. B) A process performed with minimal human assistance. C) Stuff which humans cant do. D) A process which need to be monitored. Show Answer Correct Answer: B) A process performed with minimal human assistance. 21. What is the programming word to rework something to vary the original? A) Remake. B) Re-evaluate. C) Redo. D) Remix. Show Answer Correct Answer: D) Remix. 22. How do you get the length of a string 'sentence'? A) Sentence.length(). B) Length(sentence). C) Len(sentence). D) Sentence.size(). Show Answer Correct Answer: C) Len(sentence). 23. The "Zen of Python" states that readability counts. In Python, which character is used to denote the start of a single-line comment, which helps improve readability? A) #. B) *. C) //. D) . Show Answer Correct Answer: A) #. 24. Which of these is a correct variable name in Python? A) Number 2. B) 2number. C) Number-2. D) Number 2. Show Answer Correct Answer: A) Number 2. 25. The output of the programx = 4x = "Sally"print(x) A) Four. B) Saly. C) Sally. D) None of the above. Show Answer Correct Answer: C) Sally. 26. Salah satu alasan Python populer untuk Data Science adalah karena ..... A) Tidak bisa dijalankan di Windows. B) Mudah dimengerti dan multi-platform. C) Memerlukan biaya yang sangan mahal untuk di pakai. D) Hanya bisa digunakan online. Show Answer Correct Answer: B) Mudah dimengerti dan multi-platform. 27. What is the correct function to take input from a user in Python? A) Get(). B) Input(). C) Read(). D) Scan(). Show Answer Correct Answer: B) Input(). 28. Which of the following is a correct way to name a variable? A) 1st name = Steve. B) First Name = Steve. C) 1st name = Steve. D) First name = Steve. Show Answer Correct Answer: B) First Name = Steve. 29. For the tuple t = (1, 5, 7, 10), which expression returns the largest value? A) Max(t) returns the largest value. B) Len(t) returns the largest value. C) Min(t) returns the largest value. D) Sum(t) returns the largest value. Show Answer Correct Answer: A) Max(t) returns the largest value. 30. In Python we can get a part of a list with a A) Slice. B) Piece. C) Cut. D) Slide. Show Answer Correct Answer: A) Slice. 31. Which of the following translators converts high level language into low level language atonce? A) Assembler. B) Compiler. C) C. Interpreter. D) D. None of the above. Show Answer Correct Answer: B) Compiler. 32. What is the data type of the variable 'x' when 'x = 3.14' in Python? A) Float. B) Int. C) Bool. D) Str. Show Answer Correct Answer: A) Float. 33. Which tool can be used to write and run Python code? A) Paint. B) PowerPoint. C) Microsoft Word. D) PyCharm. Show Answer Correct Answer: D) PyCharm. 34. What is the result of the following operation in Python:my ..... list = [1, 2, 3] followed by my ..... list.append(4)? A) [1, 2, 3, 3]. B) [1, 2, 3, 5]. C) [1, 2, 4, 3]. D) [1, 2, 3, 4]. Show Answer Correct Answer: D) [1, 2, 3, 4]. 35. By default, the Python scripts are saved with ..... extension. A) .pyp. B) .pys. C) .py. D) None of the above. Show Answer Correct Answer: C) .py. 36. What is the input name for 'true/false' inputs? A) Float(float). B) Bool(boolean). C) Int(boolean). D) Boo(boolean). Show Answer Correct Answer: B) Bool(boolean). 37. Salah satu alat yang dapat digunakan untuk menulis kode Python adalah ..... A) NetBeans. B) MS Access. C) Visual Basic. D) Google Collab. Show Answer Correct Answer: D) Google Collab. 38. In the statement 'x = 5', what is '5'? A) A function. B) A loop. C) A variable. D) A value. Show Answer Correct Answer: D) A value. 39. Which built-in function is used to write output to the screen? A) Read(). B) Write(). C) Print(). D) Input(). Show Answer Correct Answer: C) Print(). 40. Which of the following is invalid variable name? A) N1. B) Sum1. C) Num 1. D) Num 1. Show Answer Correct Answer: D) Num 1. 41. Write the output of the following code:a=9; x=str(a); b=5; y=str(b); x+y A) 14. B) 95. C) None of the above. D) 9, 5. Show Answer Correct Answer: B) 95. 42. What is the output of the following code? number = int("10") + 5 print(number) A) 15. B) 10. C) 105. D) 5. Show Answer Correct Answer: A) 15. 43. You have to buy Python. A) True. B) False. C) No sure. D) None of the above. Show Answer Correct Answer: B) False. 44. What will be the output of the following code? "'pythonname = input("Enter your name: ")print("Hello, ", name) "' A) Hello, Enter your name:. B) Enter your name:Hello,. C) It asks for your name and then prints Hello,. D) Error. Show Answer Correct Answer: C) It asks for your name and then prints Hello,. 45. What is the significance of the '#' symbol in Python? A) It starts a comment. B) It indicates a function. C) It denotes a variable. D) It is used for multiplication. Show Answer Correct Answer: A) It starts a comment. 46. What is the purpose of arithmetic expressions in programming? A) To execute instructions. B) To calculate values. C) To display messages. D) To translate programming languages. Show Answer Correct Answer: B) To calculate values. 47. Which keyboard key is used to run Python programs? A) F5. B) F6. C) F + n. D) Ctrl + r. Show Answer Correct Answer: A) F5. 48. What is the significance of human-readable code in programming? A) It is the only type of code that can be executed. B) It allows computers to run programs faster. C) It makes it easier for humans to understand and write code. D) It eliminates the need for programming languages. Show Answer Correct Answer: C) It makes it easier for humans to understand and write code. 49. What will be the output of the following code? print("My favourite colour is '' + "blue") A) My favourite colour is. B) My favourite colour is + blue. C) My favourite colour is blue. D) My favourite colour isblue. Show Answer Correct Answer: C) My favourite colour is blue. 50. What will be the output of the following code?x = 10y = 3print (x % y) A) 7. B) 1. C) 3. D) 0. Show Answer Correct Answer: B) 1. 51. What is the output of the following code:print(5 + 3)? A) 8. B) 6. C) 9. D) 10. Show Answer Correct Answer: A) 8. 52. What is the difference between a string and an integer in Python? A) A string is a numeric value; an integer is a sequence of characters. B) A string is always longer than an integer; an integer is always shorter than a string. C) A string is a sequence of characters; an integer is a whole number. D) A string can only contain letters; an integer can contain letters and numbers. Show Answer Correct Answer: C) A string is a sequence of characters; an integer is a whole number. 53. Which of the following has only unique values? A) Set. B) Dictionary. C) List. D) Tuple. Show Answer Correct Answer: A) Set. 54. What will happen if indentation is not used properly in Python? A) The code will still execute but give incorrect results. B) Python will raise an IndentationError. C) Python ignores indentation. D) The program will execute partially. Show Answer Correct Answer: B) Python will raise an IndentationError. 55. What is the output of the expression 3 * 4 + 5? A) 15. B) 12. C) 17. D) 20. Show Answer Correct Answer: C) 17. 56. You use ..... blocks to program Scratch A) Algorithm. B) Memory. C) Sequence. D) Code. Show Answer Correct Answer: D) Code. 57. Which of the following is true about the subprograms in the turtle graphics library module? A) They require the name of the turtle you create to the left of the dot. B) They use the library name "turtle" or a variable. C) They are not compatible with the PLS. D) They can only be used after the turtle window is closed. Show Answer Correct Answer: B) They use the library name "turtle" or a variable. 58. What does input() do in Python? A) Prints text. B) Opens the browser. C) Asks the user to type something. D) Runs a game. Show Answer Correct Answer: C) Asks the user to type something. 59. What should you do to repeat the drawing of the Slinky circles? A) Delete the old code. B) Ignore the code. C) Write new code. D) Copy and paste the code. Show Answer Correct Answer: D) Copy and paste the code. 60. Which of these is a number in Python? A) "cat". B) 'name'. C) 42. D) "5". Show Answer Correct Answer: C) 42. ← 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