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

Quiz Instructions

Select an option to see the correct answer instantly.

1. The correct way to create a variable in Python?
2. Which one of the following is correct way of declaring and initializing a variable, x with value 5?int x
3. What is the output of the following program?for i in range(0, 5):print(i) i=i+1
4. Among the following functions, which one can be used to combine dataframes when they have similar structure.
5. Write the output:import pandas as pd1 s = pd1.Series([1, 2, 3]) t = pd1.Series([1, 2, 4]) u=s-t print (u)
6. What will be the output?str1 = "Deep Learning"print (len(str1))
7. Which of the following is incorrect variable name in Python?
8. What is the output of print('Hello' + ' World')?
9. What does IDLE stand for?
10. The character that must be at the end of the line for if?
11. Write the output for the following:import pandas as pd1 s = pd1.Series(5, index=[0, 1, 2, 3]) print(s)
12. 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' )
13. Identify the arithmetic operator which is used to calculate exponential.
14. How do you take user input in Python using the input() function?
15. Which of the following is NOT a key feature of Object-Oriented Programming in Python?
16. Which of these is the definition for packages in Python?
17. S = pd.series([1, 2, 3, 4, 5], index=['a', 'b', 'c', 'd', 'e'])print(s[:3] gives?
18. What symbol is used to pass an arbitrary number of arguments to a Python function?
19. Which of these is mutable?
20. We can iterate over string
21. Which functions are used to accept input from the user.
22. Predict the output of the following code:x=3If x>2 or x<5 and x==6:Print( "ok" )else:print( "no output" )
23. In Python an ELSE IF statement is represented as what?
24. Which of these collections defines a TUPLE?
25. Which function opens a file for reading in Python?