This quiz works best with JavaScript enabled. Home > Cbse > Class 11 > Science > Computer Science > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 5 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 5 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Which of Python's collection types is ordered and changeable (elements can be modified)? A) Tuple. B) Dictionary. C) List. D) Float. Show Answer Correct Answer: C) List. 2. Which element type is considered falsy in Python when evaluating tuples? A) Non-empty strings only. B) All numbers and strings. C) Non-zero numbers only. D) 0 and empty collections. Show Answer Correct Answer: D) 0 and empty collections. 3. When you want to print something to the screen you should use A) The computer Display. B) A monitor. C) The keyboard to type it. D) A print statement. Show Answer Correct Answer: D) A print statement. 4. Who conceived Python programming? A) James Gosling. B) Bjarne Stroustrup. C) Guido van Rossum. D) Dennis Ritchie. Show Answer Correct Answer: C) Guido van Rossum. 5. Which of the following will give "Simon" as output?If str1="John, Simon, Aryan" A) Print(str1[-7:-11]). B) Print(str1[-11:-7]). C) Print(str1[-7:-12]). D) Print(str1[-11:-6]). Show Answer Correct Answer: D) Print(str1[-11:-6]). 6. What does the "turtle" represent in the Python Turtle Library? A) A controllable object on the screen. B) A physical turtle. C) An animated character. D) An image on the screen. Show Answer Correct Answer: A) A controllable object on the screen. 7. Which of the following will convert the string '"3.5"' to a float? A) Int("3.5"). B) Str(3.5). C) Bool("3.5"). D) Float("3.5"). Show Answer Correct Answer: D) Float("3.5"). 8. Choose the operators to represent "not equal to" in PYTHON A) <>. B) Not=. C) !=. D) /=. Show Answer Correct Answer: C) !=. 9. What happens if you try to add a string and an integer? A) It prints both. B) It multiplies. C) It gives an error. D) It converts automatically. Show Answer Correct Answer: C) It gives an error. 10. What is the purpose of using quotes in a 'print()' statement? A) To indicate a comment. B) To perform a calculation. C) To define a string. D) To declare a variable. Show Answer Correct Answer: C) To define a string. 11. What happens if you leave out some of the brackets in a Python command? A) The program ignores the missing brackets. B) The program runs normally. C) The program displays a warning. D) The program gives an error message. Show Answer Correct Answer: D) The program gives an error message. 12. What will the output be from the following code?print(3*4+5) A) 27. B) 17. C) 12. D) SyntaxError. Show Answer Correct Answer: B) 17. 13. What does 'if' statement do in Python? A) The 'if' statement executes code based on a condition being true. B) The 'if' statement always executes regardless of conditions. C) The 'if' statement is used to declare variables in Python. D) The 'if' statement defines a function in Python. Show Answer Correct Answer: A) The 'if' statement executes code based on a condition being true. 14. What is the output of the following code?name = Steveprint(len(Steve)) A) 5. B) Len(Steve). C) (Steve). D) 7. Show Answer Correct Answer: A) 5. 15. What is the best way to read an entire file into a single string? A) .read(). B) .readline(). C) .readlines(). D) .read(all). Show Answer Correct Answer: A) .read(). 16. ..... spaces should be left for indentation. A) 5. B) 3. C) 4. D) 0. Show Answer Correct Answer: C) 4. 17. Who created the Python programming language and when? A) Guido van Rossum in 1991. B) Ada Lovelace in 1843. C) Bill Gates in 1985. D) Mark Zuckerberg in 2004. Show Answer Correct Answer: A) Guido van Rossum in 1991. 18. A, b=0, 30a=30/(2*b)print(a) A) 1.5. B) 0. C) 15. D) 0.5. Show Answer Correct Answer: D) 0.5. 19. What will be the output of the following code?x = 10y = 4print (x // y) A) 2.0. B) 2. C) 2.5. D) 3. Show Answer Correct Answer: D) 3. 20. What is the first program going to draw? A) A line. B) A triangle. C) A slinky. D) A square. Show Answer Correct Answer: C) A slinky. 21. What is the output for the following:def func (a, b = 8, c = 10):return a + b + cprint (func (4, c = 13) ) A) 22. B) 25. C) Error. D) 27. Show Answer Correct Answer: B) 25. 22. What will be the output of the following code? "'pythonif 10 > 5:print("Ten is greater than five") "' A) 'Error'. B) 'Ten is greater than five'. C) 'Nothing'. D) '5 is less than 10'. Show Answer Correct Answer: B) 'Ten is greater than five'. 23. Which of the following is a method in Python? A) 'append()'. B) 'print()'. C) 'input()'. D) All of the above. Show Answer Correct Answer: D) All of the above. 24. What will be the output of the following code? print(5 // 2) A) 5. B) 2.5. C) 3. D) 2. Show Answer Correct Answer: D) 2. 25. What is the purpose of the print() function in Python? A) Display something in the console. B) Read user input. C) Create a loop. D) Perform mathematical calculations. Show Answer Correct Answer: A) Display something in the console. 26. Which of these is a floating point? A) Not Me!. B) True/False. C) 5. D) 23.5. Show Answer Correct Answer: D) 23.5. 27. Is Python case sensitive when dealing with identifiers? A) Yes. B) No. C) All the above. D) None of the above. Show Answer Correct Answer: A) Yes. 28. Consider t = (3, 5, 7). Which unpacking is valid? A) A, b, c, d = t. B) A = t[0], b = t[1]. C) A, b, c = t. D) A, b = t. Show Answer Correct Answer: C) A, b, c = t. 29. How can you print the string 'Hello! "Python" is fun.' with the quotes around Python? A) Print('Hello! "Python" is fun.'). B) Print("Hello! "Python" is fun."). C) Both A and B. D) Print(Hello! "Python" is fun.). Show Answer Correct Answer: C) Both A and B. 30. According to BEDMAS/PEMDAS, what is the correct order of operations? A) Brackets, Exponents, Division/Multiplication, Addition/Subtraction. B) It is evaluated strictly from left to right. C) Brackets, Division, Exponents, Multiplication, Addition, Subtraction. D) Addition, Subtraction, Multiplication, Division, Exponents, Brackets. Show Answer Correct Answer: A) Brackets, Exponents, Division/Multiplication, Addition/Subtraction. 31. Conditional statement adalah pernyataan yang digunakan untuk ..... A) Mengontrol alur atau logika dari program. B) Mengevaluasi kondisi atau ekspresi yang bernilai benar atau salah. C) Semua jawaban benar. D) Menjalankan blok kode tertentu berdasarkan hasil evaluasi kondisi atau ekspresi. Show Answer Correct Answer: C) Semua jawaban benar. 32. What is the function of a programming language? A) To create software and applications. B) To design websites. C) To send emails. D) To play games. Show Answer Correct Answer: A) To create software and applications. 33. How do you access the first character of a string in Python? A) S.first(). B) S[1]. C) S.get(0). D) S[0]. Show Answer Correct Answer: D) S[0]. 34. In computers science, variables: A) Represent parts of an experiment that are measured or tested. B) Are numbers like pi. C) Are placeholders for storing information which can change while a program runs. D) Are unchangeable. Show Answer Correct Answer: C) Are placeholders for storing information which can change while a program runs. 35. Colors = ["red", "orange", "yellow", "green", "blue", "indigo", "violet"]Choose the answer that will output False. A) Colors[-1] == "violet". B) Len(colors) == 6. C) Len(colors) == 7. D) Colors[0] == red. Show Answer Correct Answer: B) Len(colors) == 6. 36. How do you declare a comment in Python? A) //. B) . C) /* */. D) #. Show Answer Correct Answer: D) #. 37. Which of the following is NOT a feature of Python? A) Free and open-source. B) Dynamically typed. C) Interpreted language. D) Compiled language. Show Answer Correct Answer: D) Compiled language. 38. Which of the following is invalid identifier? A) 1st. B) . C) 1stName. D) While. Show Answer Correct Answer: C) 1stName. 39. What will print(type(name)) return if name = 'Abhishek'? A) Str. B) Int. C) Bool. D) None of the above. Show Answer Correct Answer: A) Str. 40. Which of these tools could a Python programmer build? A) A car engine. B) A garden hose. C) An educational website. D) A painting canvas. Show Answer Correct Answer: C) An educational website. 41. What is the output of the following code?x = int("10")y = float(x)print(y) A) Error. B) 10. C) "10". D) 10.0. Show Answer Correct Answer: D) 10.0. 42. What will be the output of the following Python code?x = ['ab', 'cd'] for i in x:x.append(i.upper()) print(x) A) ['AB', 'CD']. B) ['ab', 'cd', 'AB', 'CD']. C) ['ab', 'cd']. D) None of the mentioned. Show Answer Correct Answer: D) None of the mentioned. 43. What will be the output of the following code? "'pythonprint(type(7)) "' A) . B) . C) . D) . Show Answer Correct Answer: A) . 44. What will the following code output?print(2 == 2.0) A) True. B) False. C) TypeError. D) None. Show Answer Correct Answer: A) True. 45. What is an example of a task a robot controlled by Python can do? A) Fly an airplane. B) Edit videos. C) Write a book. D) Pick up objects. Show Answer Correct Answer: D) Pick up objects. 46. Which of the following will store the value 3.5 as a float in Python? A) Value = "3.5". B) Value = '3.5'. C) Value = 3.5. D) Value = 3, 5. Show Answer Correct Answer: C) Value = 3.5. 47. What will print(len([1, 2, 3, 4])) output? A) 3. B) 4. C) Error. D) 5. Show Answer Correct Answer: B) 4. 48. Which of these is NOT a data type? A) String. B) List. C) Number. D) Letter. Show Answer Correct Answer: D) Letter. 49. What will be the output of this code:x = 10; if x < 5:print('Low'); else:print('High')? A) Undefined. B) Low. C) High. D) Error. Show Answer Correct Answer: C) High. 50. Why does a 'NameError' occur in Python? A) Undefined variable. B) Incorrect syntax. C) Invalid input. D) Logical mistake. Show Answer Correct Answer: A) Undefined variable. 51. What will this code print? "'pythonprint("My favourite colour is blue") "' A) Print("My favourite colour is blue"). B) My favourite colour is blue. C) "My favourite colour is blue". D) My favourite colour is blue". Show Answer Correct Answer: B) My favourite colour is blue. 52. What is the output of the following code? print('A' == 'a') A) None. B) Error. C) False. D) True. Show Answer Correct Answer: C) False. 53. Named reference that holds data in memory. Assigned using the "=" sign with name on left A) References. B) Identifiers. C) Keyword. D) Variable. Show Answer Correct Answer: D) Variable. 54. How many times will the loop run?for i in range(1, 6):print(i) A) 5 times. B) 4 times. C) 6 times. D) Infinite times. Show Answer Correct Answer: A) 5 times. 55. What will be the value of 'result' after executing the following code?result = 10 > 5 and 3 < 2 A) True. B) 1. C) 0. D) False. Show Answer Correct Answer: D) False. 56. Which of the following is the equal to comparison operator in Python (used to check if two values are the same)? A) ==. B) =. C) ===. D) !=. Show Answer Correct Answer: A) ==. 57. What is the decimal of binary 111? A) 8. B) 9. C) 7. D) 6. Show Answer Correct Answer: C) 7. 58. Python is ..... language A) Compiled. B) Interpreted. C) Both compiled and interpreted. D) None of the above. Show Answer Correct Answer: B) Interpreted. 59. Which data type can store numbers, letters and symbols? A) Float. B) Integer. C) String. D) Boolean. Show Answer Correct Answer: C) String. 60. Module-2:True or False:Pretty Printing is a topic under Dictionaries and Structuring Data. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) 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 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 9 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books