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

Quiz Instructions

Select an option to see the correct answer instantly.

1. What is called when a function is defined inside a class?
2. Str="world of python programming"print(str.capitalize())
3. L ..... names=['Harsh', 'Amit', 'Sahil', 'Viresh']min(L ..... names)
4. A data type consisting of letters, numbers and symbols enclosed in quotation marks.
5. What does this symbol represent?>
6. Arithmetic OperatorsWhat is a %?
7. What is the result of following Program in python3a=10b=20c=a+bprint("Sum is"+c)
8. Look at the following code:name = "John"age = "23"What type of data is stored in the variable age?
9. Which of these will allow me to count from 0-20 in steps of 5?
10. Which of the following character is used to give single-line comments in Python?
11. If I declare a global variable, can I then use its value within the scope of a function?
12. Which of the following is a compound structure?
13. Index of a string begins with
14. Comparison Operators:Select the correct operator for not equal to
15. What character should be placed at the end of the function "def" line, after the parentheses?
16. Which of the following is an advantage of using local variables?
17. In a Python program, what would be the increment value for the looping variable in the FOR LOOP code?for x in range (25, 10, -5)
18. Inheritance can only be applied between one sub class and one super class.
19. What is the output of this expression, 3*1**3
20. A WHILE loop is .....
21. Consider this list, what will be the highest index the list can have:li=[1, 2, 3, 4, 5]
22. Items are accessed by their keys in a dictionary
23. Given a list with 3 items, what is the lowest and highest valid index number into that list?
24. Which of the following is not a valid string function?
25. Symbols used to store data; they represent a value that can change.
26. Why do certain words change color in Python?
27. Text to be output to the screen should be enclosed by '' ''
28. Str="world of python programming"print(str[::-2])
29. The following code will stop the loop if i is 3 Fill in the blanks to perform the same i = 1 ..... i < 6:if i == 3:break i += 1
30. What will be the data type of num1 if the following code is executed?num1=int('3.14')
31. Find the argument in the following code:hero.moveUp(4)
32. Which version of Python introduced list comprehensions?
33. ..... is a data type that can represent one of two values either True or False such as 1, 0, 2 > 1, 3 < 2.
34. Which statement will check to see if a is equal to b?
35. What is the output of the code?a = (33, 55)a.append(22)print(a)
36. Which one of the following has the highest precedence in the expression?
37. What is concatenation?
38. What keyword do you use to start a function?
39. What type of inheritance is illustrated in the following piece of code?class A():passclass B():passclass C(A, B):pass
40. The Python keywords/commands "break" and "continue" can be used in other structures (such as IF statements) as well as in loops.
41. Which of the following symbols is used in Python to mean "Less than or equal to" ?
42. If a function doesn't have a return statement, which of the following does the function return?
43. A variable that is defined inside a method and belongs only to the current instance of a class is known as?
44. Why is it difficult to find pythons in the Florida swamps?
45. Leo wants to create a subroutine that will roll a dice. Which syntax is correct?
46. Which operator checks if a value is not equal to another value?
47. Else if (elif) is used in which situation?
48. What is the output of the following code?var1 = 1var2 = 2var3 = "3"print(var + var2 + var3)
49. A string is immutable in Python?Every time when we modify the string, Python Always creates a new String and assigns a new string to that variable.
50. Loop that runs till the condition is true
51. S="welcome"print( s. center (15, '*'))
52. How do you identify the statements that belong to the body of a function?
53. What will be printed for the value 8 for num# program to check even or oddnum = (int)(input("enter any number"))if num%2 == 0:print("the number is even")else:print("the number is odd")
54. When using a command to move the turtle to a specific position on the drawing canvas, the middle of the canvas is represented by which coordinates?
55. In python, comment lines start with this symbol
56. If you wanted Tracy to complete her command immediately, which speed value would you use?
57. What is the Python built-in function to converts a number to a string?
58. Choose the correct data type:The surname of a userExample:Chapman
59. How do you access the last element of a list in Python?
60. Python is a ..... side programming language.