This quiz works best with JavaScript enabled. Home > Cbse > Class 11 > Science > Computer Science > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 30 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 30 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What are the rules for naming variables? A) Start with a letter or underscore, can contain letters, numbers, and underscores. B) Can start with a number. C) Can contain spaces. D) None of the above. Show Answer Correct Answer: A) Start with a letter or underscore, can contain letters, numbers, and underscores. 2. What does string concatenation mean? A) Joining two or more strings together using +. B) Printing a string in capital letters. C) Turning a string into a number. D) Deleting a string. Show Answer Correct Answer: A) Joining two or more strings together using +. 3. Which of the following is used to handle exceptions in Python? A) Try. B) Catch. C) Except. D) Finally. Show Answer Correct Answer: A) Try. 4. What is the correct extension of a Python file? A) .py. B) .python. C) .pyt. D) .pt. Show Answer Correct Answer: A) .py. 5. In which of the following mode, the interpreter executes the statement and displays the result as soon as we press 'Enter' key? A) Hybrid mode. B) Script mode. C) None of the above. D) Interactive mode. Show Answer Correct Answer: D) Interactive mode. 6. Look at the code below and identify which of the statements below are true:for loopCounter in range(10, 101, 10):print(loopCounter) A) Starts at 1, goes upto 100, increases by 1. B) Starts at 10, goes up to 100, increases by 10. C) Starts at 10, goes upto 101, increases by 10. D) Starts at 10, goes upto 10, increases by 10. Show Answer Correct Answer: B) Starts at 10, goes up to 100, increases by 10. 7. Which of the following is a command to have a message appear on the screen? A) Write. B) Input. C) Print. D) Msg. Show Answer Correct Answer: C) Print. 8. What does the following code print? "'pythonx = 5if x > 3:print("High")else:print("Low") "' A) 5. B) Low. C) Error. D) High. Show Answer Correct Answer: D) High. 9. What's the output of the below code?D = {1:1, 2:'2', '1':1, '2':3} D['1'] = 2print(D[D[D[str(D[1])]]]) A) 3. B) '2'. C) '1'. D) 1. Show Answer Correct Answer: A) 3. 10. Which of the following functions display an output to the screen? A) Output(). B) Display(). C) Post(). D) Print(). Show Answer Correct Answer: D) Print(). 11. What does the following code output? 'print("Bananas", 3, "Peaches", sep="-")' A) "Bananas"-"3"-"Peaches". B) Bananas-3-Peaches. C) Bananas-3-Peaches. D) Bananas3Peaches. Show Answer Correct Answer: B) Bananas-3-Peaches. 12. How do you create a string in Python? A) You must use a specific library to create strings. B) Strings can only be created with special characters. C) You can create a string using only numbers. D) You can create a string in Python using single quotes, double quotes, or triple quotes. Show Answer Correct Answer: D) You can create a string in Python using single quotes, double quotes, or triple quotes. 13. Comments are executable statement in Python A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 14. Course Objective:The course aims to appraise the need for working with various documents like ..... , PDF, Word and Others. A) Notepad. B) PowerPoint. C) Excel. D) Photoshop. Show Answer Correct Answer: C) Excel. 15. How to call a method? A) Method(object). B) Obj.method(). C) Method.object. D) Obj.method. Show Answer Correct Answer: B) Obj.method(). 16. What is one of the objectives of the 'Introduction to Python Programming' course? A) Learn the syntax and semantics of the Python programming language. B) Learn Java programming. C) Study web development. D) Learn about databases. Show Answer Correct Answer: A) Learn the syntax and semantics of the Python programming language. 17. What is the correct way to declare a list in Python? A) List = [1, 2, 3]. B) List = {1, 2, 3}. C) List = <1, 2, 3>. D) List = (1, 2, 3). Show Answer Correct Answer: A) List = [1, 2, 3]. 18. Data Science bertanggung jawab untuk ..... A) Menghapus data yang tidak diperlukan. B) Menyimpan data dalam cloud. C) Membuat tampilan aplikasi. D) Mengumpul, mengolah, & menganalisis data. Show Answer Correct Answer: D) Mengumpul, mengolah, & menganalisis data. 19. What data type is used for decimal numbers in Python? A) Boolean. B) Float or Decimal. C) Integer. D) String. Show Answer Correct Answer: B) Float or Decimal. 20. Which of the following is an exponent operator? A) //. B) *. C) /. D) **. Show Answer Correct Answer: D) **. 21. What should you do to keep a running total of numbers in a for loop? A) Define it for the first time before the for loop starts. B) Redefine it as itself plus some operation in the body of the for loop. C) Both of the above. D) None of the above. Show Answer Correct Answer: C) Both of the above. 22. How many pixels does Tracy move forward before drawing another circle? A) 35. B) 25. C) 15. D) 20. Show Answer Correct Answer: D) 20. 23. Which function shows the largest value? A) High(). B) Big(). C) Max(). D) Min(). Show Answer Correct Answer: C) Max(). 24. Python can be used to build A) Website. B) ERP. C) ANDROID APPS. D) ALL OF THE ABOVE. Show Answer Correct Answer: D) ALL OF THE ABOVE. 25. What if the colour entered is NOT red?colour = input( "Enter the trafficlight colour" )if colour == "Red" :print "Stop" else:print "Go" A) Stop appears on screen. B) Go appears on screen. C) Get Ready appears on screen. D) None of the above. Show Answer Correct Answer: B) Go appears on screen. 26. What is the purpose of the command "import turtle" in Python? A) To draw a turtle on the screen. B) To exit the Python environment. C) To make the "turtle" library's functions and commands available for use in your code. D) To create a new Python file. Show Answer Correct Answer: C) To make the "turtle" library's functions and commands available for use in your code. 27. What will be the output of the following code?num1 = "30"num2 = "80"print(num1 + num2) A) It will produce an error. B) 30 + 80. C) 3080. D) 110. Show Answer Correct Answer: C) 3080. 28. The term which describes the rules that govern a computer language, how it is structured and written. A) Syntax. B) Logic error. C) Debug. D) Bug. E) Syntax error. Show Answer Correct Answer: A) Syntax. 29. Which keyword is used to create a function in Python? A) Make. B) Def. C) Func. D) Function. Show Answer Correct Answer: B) Def. 30. What will the following code print?for i in range(3):if i == 1:continueprint(i) A) 0 2 3. B) 0 2. C) 0 1 2. D) 1 2. Show Answer Correct Answer: B) 0 2. 31. Which of the following is used to get the remainder of a division in Python? A) %. B) **. C) //. D) /. Show Answer Correct Answer: A) %. 32. How do you write an else statement in Python? A) Elseif:. B) Else:. C) Else if:. D) If:. Show Answer Correct Answer: B) Else:. 33. What is the purpose of the 'pass' statement in Python? A) The 'pass' statement is used to define a function. B) The 'pass' statement serves as a placeholder that does nothing. C) The 'pass' statement raises an exception. D) The 'pass' statement is a way to comment code. Show Answer Correct Answer: B) The 'pass' statement serves as a placeholder that does nothing. 34. Which value is a Float data type? A) 64. B) 0.5. C) True. D) "cat". Show Answer Correct Answer: B) 0.5. 35. What is the purpose of the 'pendown()' subprogram in the turtle library? A) Lifts the pen up. B) Sets the color of the pen. C) Puts the pen down. D) Changes the pen size. Show Answer Correct Answer: C) Puts the pen down. 36. What will the following code print? "'pythonx = 4if x > 2:print("A")else:print("B") "' A) AB. B) A. C) Nothing. D) B. Show Answer Correct Answer: B) A. 37. Kako se deklarira varijabla u Pythonu? A) Ime varijable:vrijednost. B) Ime varijable = vrijednost. C) Deklariraj ime varijable kao vrijednost. D) Vrijednost = ime varijable. Show Answer Correct Answer: B) Ime varijable = vrijednost. 38. Print("What's your favourite food?") food = input() print("I've never tried", food)When this program is executed, what will be displayed on the screen, as a result of executing line 3? A) I've never tried and whatever the user has typed at the keyboard. B) I've never tried food. C) I've never tried input(). D) It is not possible to know the output without executing the program. Show Answer Correct Answer: A) I've never tried and whatever the user has typed at the keyboard. 39. What is the purpose of the task:distance = user INPUT(), time = user INPUT(), speed = distance / time, OUTPUT:The speed of travel is + speed + m/s? A) To calculate distance from speed and time inputted by a user. B) To calculate distance from speed and time inputted by a user. C) To calculate speed from distance and time inputted by a user. D) To calculate time from speed and distance inputted by a user. Show Answer Correct Answer: C) To calculate speed from distance and time inputted by a user. 40. "True" is an example of what data type? A) Boolean. B) Integer. C) Float. D) String. Show Answer Correct Answer: D) String. 41. Which operator is used to concatenate two strings in Python? A) &. B) &&. C) +. D) *. Show Answer Correct Answer: C) +. 42. What is a module in Python? A) A built-in data type. B) A collection of functions and variables. C) A loop construct. D) A method for mathematical operations. Show Answer Correct Answer: B) A collection of functions and variables. 43. Who is the creator of Python? A) A large company. B) An anonymous group of programmers. C) Guido van Rossum. D) A team of IT specialists. Show Answer Correct Answer: C) Guido van Rossum. 44. What is an error in Python? A) An error in Python is a type of variable used for debugging. B) An error in Python is a problem in the code that prevents execution. C) An error in Python is a feature that enhances code execution. D) An error in Python is a warning that suggests improvements. Show Answer Correct Answer: B) An error in Python is a problem in the code that prevents execution. 45. What symbol is used to create a dictionary in Python? A) < >. B) ( ). C) { }. D) [ ]. Show Answer Correct Answer: C) { }. 46. Which of the following statements is true about comments in Python? A) Comments must be enclosed in double quotes. B) Comments can be written using # at the beginning of the line. C) Comments are executed by the Python interpreter. D) Comments are required after every line of code. Show Answer Correct Answer: B) Comments can be written using # at the beginning of the line. 47. X, y=3, 7print(x, y) A) 3, 7. B) 3 7. C) 7 3. D) 7, 3. Show Answer Correct Answer: B) 3 7. 48. Keyword check:In the statement age = 13, what is the identifier? A) Age. B) Age = 13. C) 13. D) =. Show Answer Correct Answer: A) Age. 49. Which function takes a users input A) Print(). B) Input(). C) Int(). D) Def. Show Answer Correct Answer: B) Input(). 50. How do you make the turtle draw a circle? A) Turtle.makeCircle(radius). B) Turtle.drawCircle(radius). C) Turtle.circleShape(radius). D) Turtle.circle(radius). Show Answer Correct Answer: D) Turtle.circle(radius). 51. A code that does a specific task is called a- A) Function. B) Method. C) Procedure. D) Routine. Show Answer Correct Answer: A) Function. 52. What is a Series in Pandas? A) A collection of key-value pairs. B) A two-dimensional array containing a sequence of values of any data type. C) A data structure used for storing images. D) A one-dimensional array containing a sequence of values of any data type. Show Answer Correct Answer: D) A one-dimensional array containing a sequence of values of any data type. 53. Which method is used to start the Tkinter event loop? A) Mainloop(). B) Start(). C) Run(). D) Execute(). Show Answer Correct Answer: A) Mainloop(). 54. What does the 'break' statement do in a loop? A) Pauses the loop. B) Exits the loop. C) Continues to the next iteration. D) Restarts the loop. Show Answer Correct Answer: B) Exits the loop. 55. Computers understand the language of 0s and 1s which is called ..... A) All of the above. B) Low level Language. C) Binary Language. D) Machine Language. Show Answer Correct Answer: A) All of the above. 56. Which programming language uses visual block coding? A) Python only. B) Scratch only. C) Both Scratch and Python. D) Neither Scratch nor Python. Show Answer Correct Answer: B) Scratch only. 57. What type of loop is most appropriate to use when you know exactly how many times you want the code block to execute (e.g., iterating through a list or using a range)? A) Until loop. B) Do-while loop. C) For loop. D) While loop. Show Answer Correct Answer: C) For loop. 58. Which of the following best describes a programming language? A) A method for storing data in a database. B) A way to talk to a computer using instructions. C) A way to create graphics and animations. D) A tool for designing websites. Show Answer Correct Answer: B) A way to talk to a computer using instructions. 59. What is the result of the expression 15 / 3 in Python? A) 4.0. B) 5.0. C) 6.0. D) 3.0. Show Answer Correct Answer: B) 5.0. 60. Num = 90Num = 20print(Num) A) 20. B) 4.5. C) 90. D) 1800. Show Answer Correct Answer: A) 20. ← 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