1. Which of the following is valid arithmetic operator in Python? (A) // (B) ? (C) < (D) and 2. Suppose a tuple T is declared as T = (10, 12, 43, 39) which of the following is incorrect? (A) print(T[1]) (B) T[2] = – 29 (C) print(max(T)) (D) print(len(T)) 3. Which of the following is invalid? (A) _a = 1 (B) __a = 1 (C) __str__ = 1 (D) none of the mentioned 4. Which of the following is/are sorting technique? (A) Bubble sort (B) Insertion sort (C) Both A and B (D) None of these 5. To open a file “c:\scores.txt” for reading, we use ......................... . (A) infile = open(“c:\scores.txt”, “r”) (B) infile = open(“c:\\scores.txt”, “r”) (C) infile = open(file = “c:\scores.txt”, “r”) (D) infile = open(file = “c:\\scores.txt”, “r”) 6. All keywords in Python are in ......................... . (A) lower case (B) UPPER CASE (C) Capitalized (D) None of these 7. To read two bytes from a file object infile, we use ............................. . (A) infile.read(2) (B) infile.read() (C...
Comments
Post a Comment