This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 51 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 51 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What is the output of the following code? print('Hello' + ' World!') A) Hello World. B) HelloWorld!. C) Hello World!. D) Hello + World!. Show Answer Correct Answer: C) Hello World!. 2. Which data type would be most suitable for storing a collection of items of different types? A) List. B) Integer. C) Boolean. D) String. Show Answer Correct Answer: A) List. 3. Bagaimana cara menambahkan komentar di Python? A) Tambahkan komentar menggunakan '/* komentar */' di Python. B) Gunakan '#' untuk menambahkan komentar di Python. C) Gunakan '//' untuk menambahkan komentar di Python. D) Gunakan '/*' untuk memulai komentar di Python. Show Answer Correct Answer: B) Gunakan '#' untuk menambahkan komentar di Python. 4. What does the 'range()' function do in Python? A) Generates a list of numbers. B) Converts data types. C) Creates a loop. D) Defines a function. Show Answer Correct Answer: A) Generates a list of numbers. 5. What will print(2 ** 3) output? A) 5. B) 6. C) 8. D) 9. Show Answer Correct Answer: C) 8. 6. What is Django primarily used for? A) Django is primarily used for web development. B) Django is primarily used for desktop software development. C) Django is primarily used for mobile app development. D) Django is primarily used for game development. Show Answer Correct Answer: A) Django is primarily used for web development. 7. Which of the following assignment will return an error? A) A = b = c = 89. B) A = 6, b = 8. C) A, b, c = 1, 2, 3. D) None of the above. Show Answer Correct Answer: B) A = 6, b = 8. 8. What function would you use to convert a string to an integer? A) ConvertToInteger(). B) StrToInt(). C) Int(). D) ParseIntString(). Show Answer Correct Answer: C) Int(). 9. How many local and global variables are there in the following Python code?var1=5def fn():var1=2var2=var1+5var1=10fn() A) 1 local, 1 global variables. B) 1 local, 2 global variables. C) 2 local, 1 global variables. D) 2 local, 2 global variables. Show Answer Correct Answer: D) 2 local, 2 global variables. 10. Who created the Python programming language? A) Guido van Rossum. B) Dennis Ritchie. C) James Gosling. D) Bjarne Stroustrup. Show Answer Correct Answer: A) Guido van Rossum. 11. What are floats in Python? A) An empty space in your code. B) Numbers with decimal points (Ex:3.2). C) Numbers greater than 100. D) Variables in your code that change value. E) Even numbers. Show Answer Correct Answer: B) Numbers with decimal points (Ex:3.2). 12. Which of the following is the first step in program development? A) Writing the code. B) Problem design. C) Problem analysis. D) Debugging. Show Answer Correct Answer: C) Problem analysis. 13. The features of Python A) Easy to read, write and learn. B) Used to develop GUI applications. C) Can use OOP. D) All is correct. Show Answer Correct Answer: D) All is correct. 14. To get the users input what function do we use? A) Input. B) Input<>. C) Input(). D) INPUT(). Show Answer Correct Answer: C) Input(). 15. What is the correct way to add comments in Python code? A) Using a dollar sign. B) Using a hash symbol. C) Using a double forward slash. D) Using a forward slash. Show Answer Correct Answer: B) Using a hash symbol. 16. Strings must always be written inside quotation marks in Python. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 17. A student wants the output to be Aisha Khan. Which line should they use? A) Print(" '' + first name + last name). B) Print(first name + last name + "."). C) Print(first name + last name + '' "). D) Print(first name + '' '' + last name). Show Answer Correct Answer: D) Print(first name + '' '' + last name). 18. What will happen if you tell Tracy 'forward 50' and run the code? A) Tracy gives an error. B) Tracy draws a circle. C) Tracy moves 50 pixels. D) Tracy moves 100 pixels. Show Answer Correct Answer: A) Tracy gives an error. 19. What is the function of syntax error? A) It will not display error message in the line of code. B) It will display error and rectify. C) It will display error message in the line of code. D) It will display no error message in the line of code. Show Answer Correct Answer: C) It will display error message in the line of code. 20. What is the result of the following code? "'pythonweight = 12.5print(type(weight)) "' A) ". B) ". C) ". D) ". Show Answer Correct Answer: A) ". 21. What data type will the variable 'age' have after executing the following code?age = input("Enter your age: ") A) Int. B) Float. C) Str. D) Bool. Show Answer Correct Answer: C) Str. 22. What is the first step to execute Python code? A) Run the code in a browser. B) Install Python. C) Compile the code. D) Write code in a text editor. Show Answer Correct Answer: B) Install Python. 23. In PLS, which of the following is NOT a primitive data type? A) Integer. B) String. C) Real. D) Boolean. Show Answer Correct Answer: B) String. 24. TRUE or FALSE:Python is named after a snake. A) TRUE. B) FALSE. C) All the above. D) None of the above. Show Answer Correct Answer: B) FALSE. 25. What should you do if you want to output the lines of your favorite song in Python? A) Use the 'show' command. B) Use the 'print' command. C) Use the 'display' command. D) Use the 'echo' command. Show Answer Correct Answer: B) Use the 'print' command. ← PreviousNext →Related 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 8Class 11 Computer Science Chapter 2 Introduction To Python Quiz 9Class 11 Computer Science Chapter 2 Introduction To Python Quiz 10 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books