Class 12 Computer Science Chapter 2 Advanced Python Programming Quiz 2 (60 MCQs)

Quiz Instructions

Select an option to see the correct answer instantly.

1. Which of the following is also known as brain of computer?
2. Python is considered to be a (a) programming language.
3. What does the command 'print("Hello, Python!")' do?
4. Which function can be used to combine dataframes based on common fields?
5. Which of the following is the type of the computer network?
6. Full form of NaN is
7. Select the correct sql statement for print records from a database table emp
8. What will be the output of this statement?>>>"a"+"bc"
9. DataFramedf Age Namerank1 28 Tomrank2 34 Jackrank3 29 Steverank4 42 RickyFind out the command used to get the following output from the above dataframe, Age rank1 28 rank2 34 rank3 29 rank4 42
10. How do you pass arguments to a Python function?
11. Which one of the following is correct way of declaring and initializing a variable, x with value 5?int x
12. What is the output of the following program?for i in range(0, 5):print(i) i=i+1
13. Among the following functions, which one can be used to combine dataframes when they have similar structure.
14. Write the output:import pandas as pd1 s = pd1.Series([1, 2, 3]) t = pd1.Series([1, 2, 4]) u=s-t print (u)
15. What will be the output?str1 = "Deep Learning"print (len(str1))
16. Which of the following is incorrect variable name in Python?
17. What does IDLE stand for?
18. Write the output for the following:import pandas as pd1 s = pd1.Series(5, index=[0, 1, 2, 3]) print(s)
19. Which one of the following if statements will not execute successfully?1) if (1, 2);print('foo')2) if (1, 2):print('foo')3) if (1):print( 'foo' )4) if (1);print( 'foo' )
20. Identify the arithmetic operator which is used to calculate exponential.
21. How do you take user input in Python using the input() function?
22. Which of the following is NOT a key feature of Object-Oriented Programming in Python?
23. Which of these is the definition for packages in Python?
24. S = pd.series([1, 2, 3, 4, 5], index=['a', 'b', 'c', 'd', 'e'])print(s[:3] gives?
25. What symbol is used to pass an arbitrary number of arguments to a Python function?
26. Which of these is mutable?
27. We can iterate over string
28. Which functions are used to accept input from the user.
29. Predict the output of the following code:x=3If x>2 or x<5 and x==6:Print( "ok" )else:print( "no output" )
30. In Python an ELSE IF statement is represented as what?
31. Which of these collections defines a TUPLE?
32. Which function opens a file for reading in Python?
33. How can you check if Python is installed on your system?
34. What is the output of the expression '3 * 2 ** 2' in Python?
35. Which of the following is correctly evaluated for this function?pow(x, y, z)
36. We can insert the new item into tuple
37. IN WHICH YEAR WAS THE PYTHON PROGRAMMING LANGUAGE DEVELOPED?
38. Which of the following is the correct way to declare a variable and assign an integer value in Python?
39. Identify the DDL commands
40. What is the correct syntax for defining a class named 'Vehicle'?
41. What is the use of the 'import' statement?
42. What are the different types of conditional statements in Python?
43. What is the outupt of the following code:m=[23, 11, 6, 7, 8, 9, 21]print(m[2:20:2])
44. What does the command '"hello" + "world"' do?
45. The purpose of bg in Tkinter widget is to .....
46. What will be the output of above Python code?str1="6/4"print("str1")
47. It is possible to draw a circle directly in Tkinter canvas?
48. What is the purpose of a function in Python?
49. Which library is used to connect python with MySQL? Write an import statement
50. Which of the following is the output of the below Python code?[Note:Python 2.7.5 and above]mylist=['a', 'aa', 'aaa', 'b', 'bb', 'bbb']print(mylist[int(-1/2)])
51. Which of the following is a benefit of Python's broad standard library?
52. What is the output of the following program?L1 = [1, 2, 3, 4]L2 = L1L3 = L1.copy()L4 = L3L1[0] = [5]print(L1, L2, L3, L4)
53. Screen inside another screen is possible by creating .....
54. ..... method is used to draw a line in canvas tkinter
55. Which method of cursor class is used to fetch records from the table
56. Which of the following is the output of the Python code fragment given below?var1 = 4.5var2 = 2print(var1//var2)
57. Which of the following statements create a dictionary?
58. The keyword used to import the Tkinter in program is .....
59. What will be the output?d = 10 < 11print (d)
60. In Python, what happens if you don't commit changes after executing SQL queries?