This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 52 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 52 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What will be the output of this code?for i in range(5):if i == 3:breakprint(i) A) 0 1 2. B) 0 1 2 3 4. C) 0 1 2 4. D) 0 1 2 4 5. Show Answer Correct Answer: A) 0 1 2. 2. What is the first step in the Green Screen effect? A) Tell the computer to look at each pixel. B) Get the background image. C) Identify the foreground object. D) Change the color of the pixels. Show Answer Correct Answer: A) Tell the computer to look at each pixel. 3. Which of the following is the final step in program development? A) Writing the code. B) Maintenance. C) Problem analysis. D) Debugging. Show Answer Correct Answer: B) Maintenance. 4. Fungsi lambda pada Python disebut juga ..... A) Named function. B) Anonymous function. C) Default function. D) Static function. Show Answer Correct Answer: B) Anonymous function. 5. How to find the length of a list in python? A) A.len(). B) Len(a). C) A.length(). D) Length(a). Show Answer Correct Answer: B) Len(a). 6. Consider nums = (5, 3, 5). After calling sorted(nums), which statement about the result is correct? A) It modifies nums into [3, 5, 5]. B) It modifies nums into (3, 5, 5). C) It returns a new list [3, 5, 5]. D) It returns a new tuple (3, 5, 5). Show Answer Correct Answer: C) It returns a new list [3, 5, 5]. 7. What is the primary purpose of an Integrated Development Environment (IDE)? A) To compile code. B) To provide comprehensive facilities for software development. C) To manage databases. D) To run code in the cloud. Show Answer Correct Answer: B) To provide comprehensive facilities for software development. 8. To print a list called fruitList we use A) Print(fruitList). B) List(print). C) FruitList.print(). D) FruitList(print). Show Answer Correct Answer: A) Print(fruitList). 9. Fungsi apa yang digunakan untuk menampilkan output ke layar dalam Python? A) Input(). B) Print(). C) Type(). D) Len(). Show Answer Correct Answer: B) Print(). 10. What type of data does input() return? A) String. B) Integer. C) Float. D) Boolean. Show Answer Correct Answer: A) String. 11. Which of the following is NOT a valid way to assign a value to a variable in Python? A) X = 7. B) 7 = x. C) Name = "Sam". D) Temp = 15.5. Show Answer Correct Answer: B) 7 = x. 12. How do you make a comment in Python? A) //. B) !!. C) #. D) . Show Answer Correct Answer: C) #. 13. What will be the output of the following code? x = "10" y = 5 print(x + str(y)) A) 15. B) 105. C) 10 5. D) Error. Show Answer Correct Answer: B) 105. 14. You have place ..... of ..... birth = "Middlesbrough" . Which line will produce a neat sentence? A) Print("You were born in" + place of birth). B) Print("You were born in '' + place of birth). C) Print("You were born in" place of birth). D) Print("You were born in" = place of birth). Show Answer Correct Answer: B) Print("You were born in '' + place of birth). 15. How to manipulate tuples? A) A[0] = (90). B) A = (75). C) A(50) = 75. D) We can't manipulate tuples in python. Show Answer Correct Answer: D) We can't manipulate tuples in python. 16. A collection of stored Python functions is called a- A) Module. B) Library. C) Package. D) Framework. Show Answer Correct Answer: B) Library. 17. What is the extension for a Python file? A) .txt. B) .py. C) .doc. D) .java. Show Answer Correct Answer: B) .py. 18. Which of the following lines of code will correctly store the number 25 as an integer in a variable called 'age'? A) Age = int("25"). B) Age = "25". C) Int age = 25. D) Age = 25.0. Show Answer Correct Answer: A) Age = int("25"). 19. What will be the data type of the variable age after executing the following code?age = input("Enter your age: ") A) Int. B) Float. C) String. D) Bool. Show Answer Correct Answer: C) String. 20. How could we represent/describe the process of a computer making a decision in a program? A) IF-THEN-ELSE. B) IF-OTHERWISE. C) WHEN-DO. D) None of the above. Show Answer Correct Answer: A) IF-THEN-ELSE. 21. What is a for loop? A) A definite loop that specifies actions on a list of items. B) A type of variable. C) An error in the program. D) None of the above. Show Answer Correct Answer: A) A definite loop that specifies actions on a list of items. 22. The datatype of a variable can be found by using the following function: A) Datatype(). B) Dtype(). C) Type(). D) Dt(). Show Answer Correct Answer: C) Type(). 23. Which is used to end an if statement block? A) End. B) Stop. C) Done. D) Indentation. Show Answer Correct Answer: D) Indentation. 24. Explain what a function is in Python. A) A function in Python is a built-in method that automatically executes on program start. B) A function in Python is a defined block of code that performs a specific task, can take inputs, and may return an output. C) A function in Python is a variable that stores data and cannot perform actions. D) A function in Python is a type of loop that iterates over a sequence of values. Show Answer Correct Answer: B) A function in Python is a defined block of code that performs a specific task, can take inputs, and may return an output. 25. Which function is used to take input from a user? A) Input(). B) Read(). C) Scan(). D) Type(). Show Answer Correct Answer: A) Input(). ← 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