hat is the output of the following?
i = 5
while True:
 if i%0O11 == 0:
Page No 12
 break
 print(i)
 i += 1
a) 5 6 7 8 9 10
b) 5 6 7 8
c) 5 6
d) error

1 Answer

Answer :

b) 5 6 7 8

Related questions

Description : What is the output of the following? i = 5 while True: if i%0O9 == 0: break print(i) i += 1 a) 5 6 7 8 b) 5 6 7 8 9 c) 5 6 7 8 9 10 11 12 13 14 15 …. d) error

Last Answer : d) error

Description : What is the output of the following? i = 1 while True: if i%2 == 0: break print(i) i += 2 a) 1 Page No 13 b) 1 2 c) 1 2 3 4 5 6 … d) 1 3 5 7 9 11 …

Last Answer : d) 1 3 5 7 9 11 …

Description : What is the output of the following? i = 1 Page No 11 while True: if i%3 == 0: break print(i) i + = 1 a) 1 2 b) 1 2 3 c) error d) none of the mentioned

Last Answer : c) error

Description : What is the output of the following? i = 2 while True: if i%3 == 0: break print(i) i += 2 a) 2 4 6 8 10 … b) 2 4 c) 2 3 d) error

Last Answer : b) 2 4

Description : What is the output of the following? i = 1 while True: if i%0O7 == 0: break print(i) i += 1 a) 1 2 3 4 5 6 b) 1 2 3 4 5 6 7 c) error d) none of the mentioned

Last Answer : a) 1 2 3 4 5 6

Description : What is the output of the following? i = 0 while i < 3: Page No 15 print(i) i += 1 else: print(0) a) 0 1 2 3 0 b) 0 1 2 0 c) 0 1 2 d) error

Last Answer : b) 0 1 2 0

Description : What is the output of the following? i = 0 while i < 5: print(i) i += 1 if i == 3: break else: print(0) a) 0 1 2 0 b) 0 1 2 c) error d) none of the mentioned

Last Answer : b) 0 1 2

Description : What will be the output? numberGames = {} numberGames[(1,2,4)] = 8 numberGames[(4,2,1)] = 10 numberGames[(1,2)] = 12 sum = 0 for k in numberGames: sum += numberGames[k] print len(numberGames) + sum Page No 36 a) 30 b) 24 c) 33 d) 12

Last Answer : a) 30

Description : hat is the output when following code is executed ? >>>print r"\nhello" The output is a) a new line and hello b) \nhello c) the letter r and then hello d) error

Last Answer : d) error

Description : What is the output of the following? print("xyyzxyzxzxyy".count('yy')) a) 2 b) 0 Page No 23 c) error d) none of the mentioned

Last Answer : a) 2

Description : What is the output of the following? i = 1 while False: if i%2 == 0: break print(i) i += 2 a) 1 b) 1 3 5 7 … c) 1 2 3 4 … d) none of the mentioned

Last Answer : d) none of the mentioned

Description : What is the output when following statement is executed ? >>>print('new' 'line') a) Error b) Output equivalent to print ‘new\nline’ Page No 22 c) newline d) new line

Last Answer : c) newline

Description : What is the output of the following? True = False while True: print(True) break a) True b) False c) None d) none of the mentioned

Last Answer : b) False

Description : What will be the output? >>>my_tuple = (1, 2, 3, 4) >>>my_tuple.append( (5, 6, 7) ) >>>print len(my_tuple) a) 1 b) 2 c) 5 d) Error

Last Answer : c) 5

Description : What is the output of the following? x = "abcdef" while i in x: print(i, end=" ") a) a b c d e f b) abcdef c) i i i i i i … d) error

Last Answer : d) error

Description : What is the output of the following? print("xyyzxyzxzxyy".count('xyy', -10, -1)) a) 2 b) 0 c) 1 d) error

Last Answer : b) 0

Description : What will be the output? d1 = {"john":40, "peter":45} Page No 40 d2 = {"john":466, "peter":45} d1 == d2 a) True b) False c) None d) Error

Last Answer : b) False

Description : Suppose that the virtual Address space has eight pages and physical memory with four page frames. If LRU page replacement algorithm is used, .............. number of page faults occur with the reference string. 0 2 1 3 5 4 6 3 7 4 7 3 3 5 5 3 1 1 1 7 2 3 4 1 (A) 11 (B) 12 (C) 10 (D) 9

Last Answer : (A) 11

Description : What is the output of the following? d = {0: 'a', 1: 'b', 2: 'c'} for i in d: print(i) Page No 18 a) 0 1 2 b) a b c c) 0 a 1 b 2 c d) none of the mentioned

Last Answer : a) 0 1 2

Description : What is the output of the following? print("xyyzxyzxzxyy".count('xyy', 2, 11)) a) 2 b) 0 c) 1 d) error

Last Answer : b) 0

Description : What is the output of the following? print("xyyzxyzxzxyy".count('xyy', 0, 100)) a) 2 b) 0 c) 1 d) error

Last Answer : a) 2

Description : What is the output of the following? x = 'abcd' for i in range(len(x)): i.upper() print (x) a) a b c d b) 0 1 2 3 c) error d) none of the mentioned

Last Answer : c) error

Description : Consider a program that consists of 8 pages (from 0 to 7) and we have 4 page frames in the physical memory for the pages. The page reference string is :  1 2 3 2 5 6 3 4 6 3 7 3 1 5 3 6 3 4 2 4 3 4 5 ... to fill available page frames with pages): (A) 9 and 6 (B) 10 and 7 (C) 9 and 7 (D) 10 and 6

Last Answer : (B) 10 and 7

Description : What is the output of the following code? a={1:"A",2:"B",3:"C"} b={4:"D",5:"E"} a.update(b) print(a) a) {1: ‘A’, 2: ‘B’, 3: ‘C’} b) Method update() doesn’t exist for dictionaries c) {1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’, 5: ‘E’} d) {4: ‘D’, 5: ‘E’}

Last Answer : c) {1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’, 5: ‘E’}

Description : What is the output of the following? x = 'abcd' for i in range(len(x)): x = 'a' print(x) Page No 17 a) a b) abcd abcd abcd c) a a a a d) none of the mentioned

Last Answer : c) a a a a

Description : What is the output of the following code? a={1:"A",2:"B",3:"C"} print(a.get(5,4)) a) Error, invalid syntax b) A c) 5 d) 4

Last Answer : d) 4

Description : What is the output when following code is executed ? names1 = ['Amir', 'Bear', 'Charlton', 'Daman'] names2 = names1 names3 = names1[:] names2[0] = 'Alice' names3[1] = 'Bob' sum = 0 for ls in (names1, names2, names3): ... if ls[1] == 'Bob': sum += 10 print sum a) 11 b) 12 c) 21 d) 22

Last Answer : d) 22

Description : What is the output of the following code? a={1:"A",2:"B",3:"C"} a.setdefault(4,"D") print(a) a) {1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’}. b) None. c) Error.

Last Answer : a) {1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’}.

Description : What is the output when following code is executed ? >>>names = ['Amir', 'Bear', 'Charlton', 'Daman'] >>>print(names[-1][-1]) a) A b) Daman c) Error d) n

Last Answer : b) Daman

Description : What is the output when following statement is executed ? >>> print(‘x\97\x98’) a) Error b) 97 98 c) x\97 d) \x97\x98

Last Answer : c) x\97

Description : What is the output of the following? x = 123 for i in x: print(i) a) 1 2 3 b) 123 c) error d) none of the mentioned

Last Answer : c) error

Description : What is the output of the following? x = 'abcd' for i in x: print(i.upper()) a) a b c d b) A B C D c) a B C D d) error

Last Answer : b) A B C D

Description : The output generated by the LINUX command : $ seq 1 2 10 will be (A) 1 2 10 (B) 1 2 3 4 5 6 7 8 9 10 (C) 1 3 5 7 9 (D) 1 5 10

Last Answer : (C) 1 3 5 7 9

Description : What is the output of the following? x = "abcdef" i = "i" while i in x: print(i, end=" ") a) no output b) i i i i i i … c) a b c d e f

Last Answer : a) no output

Description : A job has four pages A, B, C, D and the main memory has two page frames only. The job needs to process its pages in following order: ABACABDBACD Assuming that a page interrupt occurs when a new page is brought in the main ... replacement algorithms are (A) 9 and 7 (B) 7 and 6 (C) 9 and 8 (D) 8 and 6

Last Answer : (C) 9 and 8

Description : What will be the output of the following Python code? nums = set([1,1,2,3,3,3,4,4])print(len(nums)) a) 7 b) Error, invalid syntax for formation of set c) 4 d) 8

Last Answer : Answer: c Explanation: A set doesn’t have duplicate items.

Description : What will be the output of the following segment of the program? main( ) { char *s = “hello world”; int i = 7; printf(“%, *s”, i, s); } (A) Syntax error (B) hello w (C) hello (D) o world

Last Answer : Answer: Marks given to all

Description : Let A and B be two fuzzy integers defined as: A={(1,0.3), (2,0.6), (3,1), (4,0.7), (5,0.2)} B={(10,0.5), (11,1), (12,0.5)} Using fuzzy arithmetic operation given by (A) {(11,0.8), (13,1), (15,1)} ( ... ,0.2)} (D) {(11,0.3), (12,0.5), (13,0.6), (14,1), (15,0.7), (16,0.5), (17,0.2)}

Last Answer : (D) {(11,0.3), (12,0.5), (13,0.6), (14,1), (15,0.7), (16,0.5), (17,0.2)}

Description : What will be the output? d1 = {"john":40, "peter":45} d2 = {"john":466, "peter":45} d1 > d2 a) True b) False c) Error d) None

Last Answer : c) Error

Description : What will be the output? d = {"john":40, "peter":45} "john" in d a) True b) False c) None d) Error

Last Answer : a) True

Description : What will be the output? >>>t1 = (1, 2, 4, 3) >>>t2 = (1, 2, 3, 4) >>>t1 < t2 a) True b) False c) Error d) None

Last Answer : b) False

Description : What is the output when following code is executed ? >>>list1 = [11, 2, 23] >>>list2 = [11, 2, 2] >>>list1 < list2 is a) True b) False c) Error d) None

Last Answer : b) False

Description : Which one of the following is not a definition of error ? (A) It refers to the discrepancy between a computed, observed or measured value and the true, specified or theoretically correct value. (B) It ... to fail. (D) It refers to human action that results in software containing a defect or fault. 

Last Answer : The input, or clock pulse.

Description : What is the output of the following? print("xyyzxyzxzxyy".count('yy', 2)) a) 2 b) 0 c) 1 d) none of the mentioned

Last Answer : c)

Description : What is the output of the following? print("xyyzxyzxzxyy".count('yy', 1)) a) 2 b) 0 c) 1 d) none of the mentioned

Last Answer : a) 2

Description : What is the output of the following code? a={1:"A",2:"B",3:"C"} print(a.setdefault(3)) a) {1: ‘A’, 2: ‘B’, 3: ‘C’} b) C c) {1: 3, 2: 3, 3: 3} d) No method called setdefault() exists for dictionary

Last Answer : b) C

Description : print(0xA + 0xB + 0xC) : a) 0xA0xB0xC b) Error c) 0x22 d) 33

Last Answer : d) 33

Description : A LRU page replacement is used with four page frames and eight pages. How many page faults will occur with the reference string 0172327103 if the four frames are initially empty? (A) 6 (B) 7 (C) 5 (D) 8

Last Answer : (B) 7

Description : What is the output of print 0.1 + 0.2 == 0.3? a) True b) False c) Machine dependent d) Error

Last Answer : Answer: b Explanation: Neither of 0.1, 0.2 and 0.3 can be represented accurately in binary. The round off errors from 0.1 and 0.2 accumulate and hence there is a difference of 5.5511e-17 between (0.1 + 0.2) and 0.3.