SECTION-A 1. When reading a file line by line, the exact contents can be printed by: (A) Using readline ( ) (B) Using readlines ( ) (C) Using ‘,’ after every print statement (D) Both (A) & (B) 2. Choose the correct Python expression for the following mathematical expressions p+q/(r+s)4 (A) p+q / math.pow ((r+s), 4) (B) p+q/(r+s)^4 (C) p+q / math.pow (r+s,4) (D) (p+q) / math.pow (r+s) 3. Identify the correct statement for opening text file data.txt in total folder of c:drive in read mode. (A) F = open (“c:\\total\\data.txt”, “r”) (B) F = open (“c:\total\data.txt”, r) (C) F = open (“c:\total\data.txt”) (D) F = open (“\total\data.txt”, “r”) 4. A valid combination of atoms and operators forms a Python (A) Statement (B) Expression (C) Condition (D) None of these. 5. The default file open mode in Python is (A) Write (B) Read (C) Append (D) Read/write 6. In Python, a block is executed in an .................... (A) Function (B) Module (C) Py file (D) Execution frame 7. Consider ...
Comments
Post a Comment