This quiz works best with JavaScript enabled. Home > Cbse > Class 11 > Science > Computer Science > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 3 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 3 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Which of the following is the correct way to check if a number is NOT equal to 10 in Python? A) If num <> 10:. B) If num not 10:. C) If num != 10:. D) If num =! 10:. Show Answer Correct Answer: C) If num != 10:. 2. Aturan penamaan variabel Python yang benar adalah ..... A) Boleh diawali dengan angka. B) Tidak boleh mengandung garis bawah. C) Case-insensitive. D) Karakter pertama harus huruf atau garis bawah. Show Answer Correct Answer: D) Karakter pertama harus huruf atau garis bawah. 3. What will the following code print? print('Name:', name) A) Name:Abhishek. B) Name:. C) Abhishek. D) None of the above. Show Answer Correct Answer: A) Name:Abhishek. 4. What is the correct code to print 'Hello World' in Python? A) Printf('Hello World'). B) System.out.println('Hello World'). C) Print('Hello World'). D) Echo 'Hello World'. Show Answer Correct Answer: C) Print('Hello World'). 5. What would be the output of the following code snippet?a ..... dict = {'color':'blue', 'fruit':'apple', 'pet':'dog'}for key in a ..... dict:print(key) A) 'color" fruit" pet'. B) 'blue" apple" dog'. C) Colorfruitpet. D) Blueappledog. Show Answer Correct Answer: C) Colorfruitpet. 6. Data type for a whole number A) Boolean. B) String. C) Float. D) Integer. Show Answer Correct Answer: D) Integer. 7. What is the purpose of a computer program? A) To connect to the internet. B) To entertain users. C) To create computer hardware. D) To give instructions that a computer can execute to perform tasks. Show Answer Correct Answer: D) To give instructions that a computer can execute to perform tasks. 8. What does print("Good Job!") do? A) Prints the sentence on screen. B) Says good job. C) Shuts down computer. D) Saves a file. Show Answer Correct Answer: A) Prints the sentence on screen. 9. How can you change the turtle's color? A) Use turtle.setColor('color name'). B) Use turtle.color('color name') or turtle.color(r, g, b) for RGB values. C) Change the turtle's color by calling turtle.paint('color name'). D) Set the turtle's color with turtle.fill('color name'). Show Answer Correct Answer: B) Use turtle.color('color name') or turtle.color(r, g, b) for RGB values. 10. How are constants conventionally named in PLS? A) In lowercase characters. B) In camelCase characters. C) With special characters. D) In uppercase characters. Show Answer Correct Answer: D) In uppercase characters. 11. What is the output of the following code? "'pythonprint(2 ** 3) "' A) 9. B) 6. C) 5. D) 8. Show Answer Correct Answer: D) 8. 12. What role has Python started to play in the field of IT project testing, as mentioned in the passage? A) Exclusively used for manual testing. B) Carrying out repeatable test procedures. C) A minor role. D) Ignored in the testing process. Show Answer Correct Answer: B) Carrying out repeatable test procedures. 13. Name one fun thing you can do with Python. A) Tying shoes. B) Developing video games. C) Painting walls. D) Biking. Show Answer Correct Answer: B) Developing video games. 14. Which of the following is used to import a module in Python? A) Include. B) Require. C) Using. D) Import. Show Answer Correct Answer: D) Import. 15. What is the purpose of the 'input()' function in programming? A) Print output to the screen. B) Assign a value to a variable. C) Perform arithmetic calculations. D) Receive input from the user. Show Answer Correct Answer: D) Receive input from the user. 16. Manakah dari berikut ini yang merupakan nama variabel yang valid di Python? A) Variable@name. B) 1variable. C) Variable-name. D) Variable1. Show Answer Correct Answer: D) Variable1. 17. What is the purpose of the print() function? A) To perform mathematical calculations. B) To display output to the user. C) To define a variable. D) To create a loop. Show Answer Correct Answer: B) To display output to the user. 18. Which keyword is used to create a conditional statement in Python? A) If-else. B) If. C) Elif. D) Else. Show Answer Correct Answer: B) If. 19. Which function from the random module returns a random integer between two given integers, inclusive? A) Random.random(). B) Random.randint(). C) Random.uniform(). D) Random.choice(). Show Answer Correct Answer: B) Random.randint(). 20. Which of these is a valid comment line in Python? A) # This is a comment. B) C) ** This is a comment. D) // This is a comment. Show Answer Correct Answer: A) # This is a comment. 21. Is the not equal operator in python A) X=. B) Not =. C) Not equal. D) !=. Show Answer Correct Answer: D) !=. 22. Which of the following is a built-in function in Python? A) Output(). B) Display(). C) Print(). D) Show(). Show Answer Correct Answer: C) Print(). 23. ..... are written with a decimal point that seprate the integer from the fractional number. A) FLOATING POINT NUMBER. B) IRRATIONAL NNUMBER. C) REAL NUMBER. D) SINK POINT NUMBER. Show Answer Correct Answer: B) IRRATIONAL NNUMBER. 24. What is data input? A) Data that put in to the computer. B) Data that is sent out to the user after processing. C) Data processing. D) None of the above. Show Answer Correct Answer: A) Data that put in to the computer. 25. What type of programming language is Python classified as? A) Low-level. B) Markup. C) Interpreted. D) Compiled. Show Answer Correct Answer: C) Interpreted. 26. What is the purpose of combining variables in Python? A) To delete variables. B) To create loops. C) To compare variables. D) To concatenate variables to create sentences. Show Answer Correct Answer: D) To concatenate variables to create sentences. 27. What does len() do? A) Subtracts numbers. B) Gives the length. C) Adds numbers. D) Multiplies numbers. Show Answer Correct Answer: B) Gives the length. 28. Apa ekstensi file yang benar untuk file Python? A) .pyth. B) Python.file. C) .py. D) .script. Show Answer Correct Answer: C) .py. 29. Whitespace adalah ..... A) Karakter yang digunakan untuk membuat indentasi atau rata kiri pada kode. B) Karakter yang tidak terlihat seperti spasi, tab, atau baris baru. C) Semua jawaban benar. D) Karakter kosong yang digunakan untuk memisahkan kata atau simbol. Show Answer Correct Answer: B) Karakter yang tidak terlihat seperti spasi, tab, atau baris baru. 30. What is the output of print('Python' * 2)? A) PythonPython. B) Python2. C) Python Python. D) PyhtonPython. Show Answer Correct Answer: A) PythonPython. 31. Computer languages that are designed to be used and understood by humans are ..... A) Machine code. B) Binary code. C) Natural languages. D) High-level languages. Show Answer Correct Answer: D) High-level languages. 32. What file extension do Python programs have? A) .txt. B) .java. C) .html. D) .py. Show Answer Correct Answer: D) .py. 33. Which statement creates an empty set in Python? A) (). B) []. C) Set(). D) {}. Show Answer Correct Answer: C) Set(). 34. How do you create a list in Python? A) You create a list in Python using curly braces, e.g., my list = {1, 2, 3}. B) You create a list in Python by using parentheses, e.g., my list = (1, 2, 3). C) You create a list in Python using square brackets, e.g., my list = [1, 2, 3]. D) You create a list in Python with the list() function, e.g., my list = list(1, 2, 3). Show Answer Correct Answer: C) You create a list in Python using square brackets, e.g., my list = [1, 2, 3]. 35. The CIE marks for the theory component of the IC shall be ..... marks and for the laboratory component ..... marks. A) 40 marks; 10 marks. B) 20 marks; 30 marks. C) 30 marks; 20 marks. D) 25 marks; 25 marks. Show Answer Correct Answer: C) 30 marks; 20 marks. 36. What is Python's logo? A) Two snakes. B) A rocket. C) A robot. D) A cat. Show Answer Correct Answer: A) Two snakes. 37. Which of the following Python commands will display the text "Hello, World!" on the screen? A) Display("Hello, World!"). B) Echo("Hello, World!"). C) Print("Hello, World!"). D) Show("Hello, World!"). Show Answer Correct Answer: C) Print("Hello, World!"). 38. What Python keyword is used to define (create) a new function? A) Func. B) Def. C) Function. D) Define. Show Answer Correct Answer: B) Def. 39. What is the output of the following code?def multiply (x, y = 2):return x * yprint (multiply (4) ) A) 4. B) 5. C) Error. D) 8. Show Answer Correct Answer: D) 8. 40. What does the term "debugging" mean? A) Encrypting a program. B) Writing code for a new application. C) Fixing errors in a program. D) Removing unnecessary code. Show Answer Correct Answer: C) Fixing errors in a program. 41. Which of the following is the correct way to declare a variable in Python? A) Int age = 15. B) Variable age = 15. C) Let age = 15. D) Age = 15. Show Answer Correct Answer: D) Age = 15. 42. What is the purpose of the 'forward 20' command in the program? A) To increase the circle's radius. B) To move Tracy forward 20 pixels. C) To decrease the circle's radius. D) To move Tracy backward 20 pixels. Show Answer Correct Answer: B) To move Tracy forward 20 pixels. 43. What is a input? A) To plug in something. B) A function that allows us to ask the user to enter some data. C) Data displayed on a screen. D) A function. Show Answer Correct Answer: B) A function that allows us to ask the user to enter some data. 44. How many times will the following loop execute?for i in range(3):print(i) A) 2. B) 3. C) 1. D) 4. Show Answer Correct Answer: B) 3. 45. What happens if you use the 'forward' command without parentheses? A) Tracy draws a circle. B) Tracy gives an error. C) Tracy moves forward. D) Nothing happens. Show Answer Correct Answer: B) Tracy gives an error. 46. What data type is used to represent whole numbers in Python? A) Float. B) Boolean. C) String. D) Int. Show Answer Correct Answer: D) Int. 47. A program written in a high-level language is called ..... code A) None of the above. B) Machine. C) Source. D) Object. Show Answer Correct Answer: C) Source. 48. What is the output of the expression 20-7 in Python? A) 13. B) 12. C) 14. D) 15. Show Answer Correct Answer: A) 13. 49. How do you call a function named hello()? A) Call hello. B) Hello(). C) Say hello. D) Run hello. Show Answer Correct Answer: B) Hello(). 50. What type of loop is a 'while' loop in repetition constructs? A) Condition-controlled loop. B) Count-controlled loop. C) An infinite loop. D) None of the above. Show Answer Correct Answer: A) Condition-controlled loop. 51. What is a statement in programming? A) A comment in the code. B) A complete instruction that tells the computer what to do. C) A loop structure. D) A variable declaration. Show Answer Correct Answer: B) A complete instruction that tells the computer what to do. 52. The punctuation requirements for printing a string in Python are: A) ( ), ! and '' ''. B) ( ) and !. C) ( ) and '' ''. D) '' '' and !. Show Answer Correct Answer: C) ( ) and '' ''. 53. For i in range(-3), how many times this loop will run and print the next statement? A) Infinite. B) 1. C) Will not print. D) 0. Show Answer Correct Answer: C) Will not print. 54. Which of the following is a correct for loop in Python to iterate over a list called numbers? A) For i to numbers:. B) For i in numbers:. C) For i of numbers:. D) For i from numbers:. Show Answer Correct Answer: B) For i in numbers:. 55. Which statement about computer memory is correct? A) Secondary Memory is volatile. B) RAM always retains its data. C) ROM is volatile. D) RAM is volatile. Show Answer Correct Answer: D) RAM is volatile. 56. What is the purpose of PyCharm? A) To draw images. B) To create videos. C) To write and run Python code. D) To play music. Show Answer Correct Answer: C) To write and run Python code. 57. The shortcut for integer is ..... ? A) Int. B) Iit. C) Imt. D) Ibt. Show Answer Correct Answer: A) Int. 58. What does the print() function do? A) Displays text on the screen. B) Runs a Python program. C) Reads input from the user. D) Saves data to a file. Show Answer Correct Answer: A) Displays text on the screen. 59. What is the correct way to get input from a user? A) Scan(). B) Read(). C) Get(). D) Input(). Show Answer Correct Answer: D) Input(). 60. What does Python's "interpreted language" feature mean? A) Python is only used for web development. B) Python executes code line by line without compiling. C) Python cannot run on multiple platforms. D) Python code must be converted to machine code before running. Show Answer Correct Answer: B) Python executes code line by line without compiling. ← 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 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 8Class 11 Computer Science Chapter 2 Introduction To Python Quiz 9 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books