Professional Documents
Culture Documents
9. By the use of which character, single line is made comment in Python? A.* B. # C. @ D. !
11. Which of the following is incorrect variable name in Python? A. variable_1 B. variable1 C.
1variable D. _variable
12. Which of the following is not a relational operator in Python? A. >= B. <= C. = D. !=
13. Which statement is correct? A. List is immutable and Tuple is mutable B. List is mutable and
Tuple is immutable C. Both are mutable D. Both are immutable
14. Suppose a list with name arr, contains 5 elements. You can get the 2nd element from the list
using A. arr[-2] B. arr[2] C. arr[-1] D. arr[1]
15. How to get the last element of list in Python? Suppose we have list with name arr, contain 5
elements . A. arr[0] B. arr[5] C. arr[last] D. arr[-1]
16. How to copy one list to another in python? A. |1[] = |2[] B. |1[] = |2 C. |1[] = | 2[:] D. |1 = |2
17. What type of data is: arr=[(1,1),(2,2),(3,3)]? A. Array of tuples B. Tuples of list C. List of tuples D.
Invalid type
18. What is the output of the following program: print ((1,2)+(3,4)) A.(1,2),(3,4) B. (4,6) C. (1,2,3,4) D.
Invalid syntax
19. Which of the following is mutable data type? A. set B. int C. str D.
20. Which of the following is immutable data type? A. list B. set C. int D. dict
21. Which of the following is incorrect regarding variable in python? A. variable names in python
cannot start with number. However, it can contain number in any other position of variable name B.
variable names can start with an underscore C. Data type of variable names should not be declared
D. None of the above
22. Which of the following will give error? A. a=b=c B. a,b,c=1 C. a,b,c=1 "python", 1.5 D. None of the
above
24. What is the maximum length of an Identifier in python? A. 32 B. 31 C. 63 D. None of the above
25. All keywords in python are in A. Lowercase B. Uppercase C. Both Uppercase and Lowercase D.
None of the above
26. Which of the following statement is false A. Variable name can be arbitrarily long B. They can
contain both letters and numbers C. Variable can begin with underscore D. Variable can begin with
number
27. Which of the following is a valid variable? A. Var@ B. 32var C. Class D. abc_a_c
29. Which of the following is not used in loop in python? A. For loop B. While loop C. do-while loop
D. None of the above