Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 3 (60 MCQs)

Quiz Instructions

Select an option to see the correct answer instantly.

1. This is a catch-all for every other situation besides the one where the condition is true.
2. Exponent operator ** has (a) associativity in Python.
3. What does built-in function type do in context of classes?
4. Logical operators:True if both operands are true
5. What is the output of the following code?def calculate (num1, num2=4):res = num1 * num2print(res)calculate(5, 6)
6. S1="Hello"n1=10print(s1+n1)What is the error in this code?
7. Which of the following is a feature of Python DocString?
8. Suppose you have the following tuple definition:t = ('foo', 'bar', 'baz')Which of the following statements replaces the second element ('bar') with the string 'qux':
9. What syntax would you use to create a name variable?
10. Which of the following is true about if-elif-else statements?
11. Random.randrange(6)
12. Fixing errors in programming is called .....
13. Which word completes this sentence: "Iteration makes code more ..... "
14. Which one of the following is correct way of declaring and initializing a variable, x with value 5?
15. What key word is does this define?A container used to store a value
16. Look at the following code:name = input ("What is your name? ")name = input ("What is your age? ")print (name)If the user answered "John" to the first question and "23" to the second, what will be printed?
17. Which code would i use to add an item to a list?
18. ..... data type contain integer values with decimal such as 10.1, 5555.0, 33.33 etc.
19. How is a code block indicated in Python?
20. Select the correct answer:x = 15y = 4print(x // y)
21. Clara is writing a program that will print out the first ten numbers of a times table (chosen by the user). Should she use .....
22. L ..... names=['Harsh', 'Amit', 'Sahil', 'Viresh']L ..... names.pop()
23. Variable.sort() will do what?
24. Exception disrupts the
25. In Python the multiplication sign is .....
26. What is the output of the following loop:-for l in 'Jhon':if l == 'o':pass print(l, end=", ")
27. ..... is information the user sends to the computer
28. Which of the following concepts is not a part of Python?
29. Look at the following code:Length = 50Width = 30Area = L * Wprint (Area)What is the result of this code?
30. What is the mutable object given below?
31. What is the output of program below?bicycles = ['trek', 'cannondale', 'redline', 'specialized']print(bicycles[-1])
32. What is printed?cheer = "Go Eagles!"print cheer[:5]
33. What will be the output of this code?x = 14y = 13y = x + 3if x<=y:print("Hurray")else:print("Yay")
34. Which of the following is true for a tuple?
35. What is the syntax to check if two values are equal in Python?
36. A while loop can be used in which of the following situations?
37. There can be an else statement without an if statement
38. Is a list in Python mutable or immutable?
39. "AB-CD-EF" .partition('-'), the function returns the output
40. Identify the initialization method for a Car class.
41. What is the result of the following code?x = "Hello"print(bool(x))
42. To display something on the screen, use this command:
43. Print(boolean(None, "String", False, "False", 0, "value")What is the output?
44. Which of the following statements will cause a "while" loop to immediately exit without running any more statements in the body or checking the logical expression again?
45. What will be the output of the following code?def fn1(c=10):print(c) fn1(4)fn1()
46. Data type that can only be true or false
47. ..... is a data type that contain a set of characters (letters, symbols, etc.) E.g. "Hello", "Ali", "Car Type"
48. Converts a number to a string
49. Which of these is NOT a loop in python?
50. If you wished a loop to repeat 3 types whwt should you use?
51. What is missing from this input statement?input ("What is your name? ")
52. When you want to hide the turtle pointer on the screen which command should you use?
53. The objects that the variable refers to
54. Pieces of code that only run "under certain conditions":
55. Which operator is known as ternary operator in python?
56. Which keyword is used for an infinite loop or ITERATION?
57. The data structure which is a mutable ordered sequence of elements is called
58. What is the correct term for this symbol?" ''
59. Which is known as simple assignment operator?
60. What does this code do? print("Hello world!")