This quiz works best with JavaScript enabled. Home > Cbse > Class 11 > Science > Computer Science > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 32 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 32 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Which statement correctly describes all(tuple)? A) Returns True if all elements are truthy. B) Returns True if any element is truthy. C) Returns False only for empty tuples. D) Ignores booleans inside tuples. Show Answer Correct Answer: A) Returns True if all elements are truthy. 2. What will be the data type of the following variable? A = '101' A) Float. B) String. C) Integer. D) None of the above. Show Answer Correct Answer: B) String. 3. What other name do Errors in Python have? A) Failures. B) Booleans. C) Exercises. D) Exceptions. Show Answer Correct Answer: D) Exceptions. 4. What does print("hello) display? A) "hello. B) Hello. C) Gives you an error. D) "hello". Show Answer Correct Answer: C) Gives you an error. 5. What is one of the key features of Python as a programming language? A) It is the fastest programming language available. B) It is difficult to learn for beginners. C) It has a complex syntax that is hard to read. D) It is an easy-to-learn programming language. Show Answer Correct Answer: D) It is an easy-to-learn programming language. 6. What is the output of the following Python code? a = "7" b = int(a) print(b + 3) A) 10. B) 37. C) TypeError. D) 73. Show Answer Correct Answer: A) 10. 7. In the expression (x + y) / 4, which symbols are the operators? A) X and y. B) ( and ). C) + and /. D) X and /. Show Answer Correct Answer: C) + and /. 8. How do you count rows in SQL? A) COUNT(). B) SUM(). C) TOTAL. D) NUMBER(). Show Answer Correct Answer: A) COUNT(). 9. Which of the following environments can be used to write Python code? A) Notepad. B) PyCharm. C) Command Prompt/Terminal. D) All of the above. Show Answer Correct Answer: D) All of the above. 10. For strings, the + operator represents A) Addition. B) Appending. C) Recantation. D) Concatenation. Show Answer Correct Answer: D) Concatenation. 11. Which of the following is a primitive data type in Python? A) String. B) Float. C) List. D) Int. Show Answer Correct Answer: D) Int. 12. Which of the following is a NOT a characteristic of a Lambda function? A) Anonymous function. B) Function calling itself. C) Function without def keyword. D) Function can take multiple arguments. Show Answer Correct Answer: B) Function calling itself. 13. Which data structure allows duplicate elements? A) Set. B) Dictionary. C) List. D) None. Show Answer Correct Answer: C) List. 14. What is the output of print(len('Hello'))? A) Hello. B) 6. C) 5. D) 4. Show Answer Correct Answer: C) 5. 15. What will be the output of the following code? "'pythonprint("Python" .lower()) "' A) Python. B) PYTHON. C) Python. D) PYTHON. Show Answer Correct Answer: A) Python. 16. Which operator is used for logical operations in Python? A) And. B) Or. C) ||. D) &&. Show Answer Correct Answer: A) And. 17. What does the else statement do? A) Handles false conditions. B) Defines a function. C) Repeats code. D) Stores data. Show Answer Correct Answer: A) Handles false conditions. 18. Which operator is used for subtraction? A) -. B) +. C) /. D) *. Show Answer Correct Answer: A) -. 19. What will be the output of the following code?print("Welcome to", "Python", "Programming!") A) Welcome to-Python-Programming!. B) Welcome toPythonProgramming!. C) Welcome to Python Programming!. D) Welcome to, Python, Programming!. Show Answer Correct Answer: C) Welcome to Python Programming!. 20. Which of the following is the correct way to output the value of a variable called 'height' in Python? A) Output(height). B) Display(height). C) Echo(height). D) Print(height). Show Answer Correct Answer: D) Print(height). 21. What is the name of the data type of True? A) Int. B) Boolean. C) Float. D) String. Show Answer Correct Answer: B) Boolean. 22. Which statement prints I am 10 years old? A) Pint("I am 10 years old."). B) Print('I am 10 years old.). C) Print(" )I am 10 years old. D) Print("I am 10 years old."). Show Answer Correct Answer: D) Print("I am 10 years old."). 23. How does high-level get translated into low-level? A) Interpreters and compilers. B) Only interpreters. C) Only compilers. D) None of the above. Show Answer Correct Answer: A) Interpreters and compilers. 24. Name=input("What is your name? ")print("Your name is '' + name)What will be displayed if the user types in "Bob" ? A) Your name is name. B) Name. C) Your name is Bob. D) Bob. Show Answer Correct Answer: C) Your name is Bob. 25. The ..... loop is used when you are sure about how many times a loop body is executed. A) While. B) For. C) While else. D) None of the above. Show Answer Correct Answer: B) For. 26. Which control structure will execute an instruction only after the computer evaluates conditions to determine if a certain condition exists? A) Selection. B) Sequence. C) Functional. D) Loop. Show Answer Correct Answer: A) Selection. 27. How do you create an empty list in Python? A) 'list = <>'. B) 'list = {}'. C) 'list = []'. D) 'list = ()'. Show Answer Correct Answer: C) 'list = []'. 28. What is the correct syntax to take user input? A) Name = input('Enter name:'). B) Name = read('Enter name:'). C) Name = get('Enter name:'). D) None of the above. Show Answer Correct Answer: A) Name = input('Enter name:'). 29. Tipe data list pada Python ditandai dengan tanda ..... A) (). B) {}. C) "". D) []. Show Answer Correct Answer: D) []. 30. How do you make the turtle invisible on the screen? A) Turtle.begin fill(). B) Turtle.hideturtle(). C) Turtle.fillcolor(). D) Turtle.showturtle(). Show Answer Correct Answer: B) Turtle.hideturtle(). 31. What is the purpose of the 'continue' statement in a loop? A) To exit the loop. B) To skip the current iteration. C) To pause the loop. D) To restart the loop. Show Answer Correct Answer: B) To skip the current iteration. 32. What type of loop is 'for'? A) Selection. B) Repeat. C) Conditional. D) Fixed. Show Answer Correct Answer: D) Fixed. 33. What data type will the variable 'weight' have after this code runs? "'pythonweight = input("Enter your weight in pounds: ") "' A) Bool. B) Int. C) Str. D) Float. Show Answer Correct Answer: C) Str. 34. True and False are sample of ..... ? A) Boolean. B) Booleen. C) Booleam. D) Boleam. Show Answer Correct Answer: A) Boolean. 35. Colors = ["red", "orange", "yellow", "green", "blue", "indigo", "violet"]Choose the answer that will output True. A) Colors[1] == red. B) Colors[2] == "red". C) Colors[0] == "red". D) Colors[-1] == "red". Show Answer Correct Answer: C) Colors[0] == "red". 36. Print (Today is Monday !) will display A) Today is Monday. B) An error message. C) Today is Monday!. D) None of the above. Show Answer Correct Answer: B) An error message. 37. Which of the following is an example of Python's use in Artificial Intelligence (AI)? A) Creating smart programs and simple games. B) Writing novels. C) Building physical machines. D) Painting pictures. Show Answer Correct Answer: A) Creating smart programs and simple games. 38. Start with items = ("pen", "book"). To add "eraser" using tuple concatenation, which code is correct? A) Items.append("eraser") mutates tuple. B) Items += ("eraser", ) concatenates. C) Items = items + ["eraser"] mixes types. D) Items.insert(1, "eraser") modifies. Show Answer Correct Answer: B) Items += ("eraser", ) concatenates. 39. Which subprogram is used to remove certain characters when reading from and writing to files in Python? A) Strip(). B) Split(). C) Append(). D) Join(). Show Answer Correct Answer: A) Strip(). 40. What will be the output after the following statements?x = 8 y = 2 print(x // y) A) 4. B) 16. C) 16.0. D) 4.0. Show Answer Correct Answer: A) 4. 41. Which of the following data types can store decimal numbers? A) Float. B) Str. C) Complex. D) Int. Show Answer Correct Answer: A) Float. 42. How do you install a package in Python using pip? A) Pip get package name. B) Pip add package name. C) Pip fetch package name. D) Pip install package name. Show Answer Correct Answer: D) Pip install package name. 43. How do you convert a string "123" to an integer in Python? A) Float("123"). B) String("123"). C) Str("123"). D) Int("123"). Show Answer Correct Answer: D) Int("123"). 44. What is the purpose of the 'return' statement? A) The purpose of the 'return' statement is to exit a function and provide a value to the function caller. B) The 'return' statement is used to define a function's parameters. C) The 'return' statement is for printing output to the console. D) The 'return' statement allows for looping through a function. Show Answer Correct Answer: A) The purpose of the 'return' statement is to exit a function and provide a value to the function caller. 45. When naming a variable what must be taking into consideration? A) Use uppercase. B) Nothing. C) Name must not include spaces. D) Use lowercase. Show Answer Correct Answer: D) Use lowercase. 46. To make decisions in our code we can use which statement A) If. B) Str. C) Input. D) Print. Show Answer Correct Answer: A) If. 47. Which of the following is a lambda function in Python? A) A recursive function. B) A function that takes no arguments. C) An anonymous function. D) A named function. Show Answer Correct Answer: C) An anonymous function. 48. What command can you use to check if Python is installed? A) Python version or python3 version. B) Python check. C) Py info. D) Python version check. Show Answer Correct Answer: A) Python version or python3 version. 49. How did Python, the programming language, get its name? A) Guido van Rossum name it to honor Monty Python's Flying Circus, a BBC comedy series popular in the 1970s. B) Guido van Rossum name it after the Pythonidae-a family of large, nonvenomous snakes. C) Guido van Rossum name it to honor Python of Catana, a dramatic poet of the time of Alexander the Great. D) None of the above. Show Answer Correct Answer: A) Guido van Rossum name it to honor Monty Python's Flying Circus, a BBC comedy series popular in the 1970s. 50. How to create a dictionary? A) Dict = []. B) Dict = (). C) Dict = {key:values}. D) None of the above. Show Answer Correct Answer: C) Dict = {key:values}. 51. Which symbol is used in variable length arguments to specify more arguments than specified? A) &. B) %. C) *. D) #. Show Answer Correct Answer: C) *. 52. Why is the space important in "in '' when concatenating? A) It makes the code run faster. B) It changes the identifier. C) It stops words from joining together in the output. D) It turns the variable into an integer. Show Answer Correct Answer: C) It stops words from joining together in the output. 53. Which of the following is a valid print statement in Python? A) Print('Python is fun!"). B) Print('Python is fun!'). C) Print("Let's learn Python!"). D) Print(Hello, Python!). Show Answer Correct Answer: C) Print("Let's learn Python!"). 54. Which of the following will correctly take a user's input and store it in a variable called name? A) Input(name = "Enter your name: "). B) Input("Enter your name: ") = name. C) Name = input("Enter your name: "). D) Name = input("Enter your name"). Show Answer Correct Answer: C) Name = input("Enter your name: "). 55. A while loop while run as long as its condition is A) True. B) Executed. C) Greater than 0. D) False. Show Answer Correct Answer: A) True. 56. Which one of these is another programming language? A) Logo. B) Pogo. C) Lego. D) Icon. Show Answer Correct Answer: A) Logo. 57. Which of these is used to join two strings? A) ,. B) &. C) *. D) +. Show Answer Correct Answer: D) +. 58. Which of the following is not a type of argument? A) Static Argument. B) Default Argument. C) Keyword Argument. D) Positional Argument. Show Answer Correct Answer: A) Static Argument. 59. Reserved word or "name" that identifies built-in operations, functions, I/O operations, or conditionals that may not be used to name variables, functions, or any other type of identifier. A) Keyword. B) Don't use names. C) Identifiers. D) Variable. Show Answer Correct Answer: A) Keyword. 60. What will be the output of range(5)? A) 1 to 4. B) 1 to 5. C) 0 to 5. D) 0 to 4. Show Answer Correct Answer: D) 0 to 4. ← 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