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

1 Answer

Answer :

b) False

Related questions

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 : 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 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 : Suppose list1 is [2, 33, 222, 14, 25], What is list1[:-1] ? a) [2, 33, 222, 14]. b) Error c) 25 d) [25, 14, 222, 33, 2].

Last Answer : a) [2, 33, 222, 14].

Description : Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1] ? a) Error b) None c) 25 d) 2

Last Answer : c) 25

Description : Suppose list1 is [1, 5, 9], what is sum(list1) ? a) 1 b) 9 c) 15 d) Error

Last Answer : c) 15

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 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 piece of code when executed in Python shell? >>> a=("Check")*3 >>> a a) (‘Check’,’Check’,’Check’) b) * Operator not valid for tuples c) (‘CheckCheckCheck’) d) Syntax erro

Last Answer : c) (‘CheckCheckCheck’)

Description : What is the output when following code is executed ? >>>str1="helloworld" >>>str1[::-1] a) dlrowolleh b) hello c) world d) helloworld

Last Answer : a) dlrowolleh

Description : What is the output when following code is executed ? >>> str1 = 'hello' >>> str2 = ',' >>> str3 = 'world' >>> str1[-1:] a) olleh b) hello c) h d) o

Last Answer : b) hello

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 = 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 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 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? 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 : 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 : Suppose d = { john :40, peter :45}, what happens when we try to retrieve a value using the expression d[ susan ]? a) Since susan is not a value in the set, Python raises a KeyError ... Python raises a KeyError exception d) Since susan is not a key in the set, Python raises a syntax error

Last Answer : c) Since “susan” is not a key in the set, Python raises a KeyError exception

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 : To remove string “hello” from list1, we use which command ? a) list1.remove(“hello”) b) list1.remove(hello) c) list1.removeAll(“hello”) d) list1.removeOne(“hello”)

Last Answer : d) list1.removeOne(“hello”)

Description : To insert 5 to the third position in list1, we use which command ? a) list1.insert(3, 5) b) list1.insert(2, 5) c) list1.add(3, 5) d) list1.append(3, 5)

Last Answer : a) list1.insert(3, 5)

Description : To add a new element to a list we use which command ? a) list1.add(5) b) list1.append(5) c) list1.addLast(5) d) list1.addEnd(5)

Last Answer : a) list1.add(5)

Description : Suppose list1 = [0.5 * x for x in range(0, 4)], list1 is : a) [0, 1, 2, 3]. b) [0, 1, 2, 3, 4]. c) [0.0, 0.5, 1.0, 1.5]. d) [0.0, 0.5, 1.0, 1.5, 2.0].

Last Answer : c) [0.0, 0.5, 1.0, 1.5].

Description : Suppose list1 is [1, 3, 2], What is list1 * 2 ? a) [2, 6, 4]. b) [1, 3, 2, 1, 3]. c) [1, 3, 2, 1, 3, 2] . D) [1, 3, 2, 3, 2, 1].

Last Answer : c) [1, 3, 2, 1, 3, 2] .

Description : Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], which of the following is correct syntax for slicing operation? a) print(list1[0]) b) print(list1[:2]) c) print(list1[:-2]) d) all of the mentioned

Last Answer : d) all of the mentioned

Description : To shuffle the list(say list1) what function do we use ? a) list1.shuffle () b) shuffle(list1) c) random.shuffle(list1) d) random.shuffleList(list1)

Last Answer : c) random.shuffle(list1)

Description : Suppose list1 is [3, 5, 25, 1, 3], what is min(list1) ? a) 3 b) 5 c) 25 d) 1

Last Answer : d) 1

Description : Suppose list1 is [2445, 133, 12454, 123], what is max(list1) ? a) 2445 b) 133 c) 12454 d) 123

Last Answer : c) 12454

Description : Which of the following commands will create a list? a) list1 = list() b) list1 = []. c) list1 = list([1, 2, 3]) d) all of the mentioned

Last Answer : d) all of the mentioned

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 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 of the following code? >>> a=(1,2,3,4) >>> del(a[2]) a) Now, a=(1,2,4) b) Now, a=(1,3,4) c) Now a=(3,4) d) Error as tuple is immutable

Last Answer : d) Error as tuple is immutable

Description : What is the output when following statement is executed ? >>>"abcd"[2:] a) a b) ab c) cd d) dc

Last Answer : c) cd

Description : What will be the output at PORT1 if the following program is executed? MVI B, 82H MOV A, B MOV C, A MVI D, 37H OUT PORT1 HLT (A) 37H (B) 82H (C) B9H (D) 00H

Last Answer : Answer: B Explanation: In 8085 programming, the result of an operation is stored in the accumulator. So output is 82H.

Description : When the following code is executed what will be the value of x and y? int x = 1, y=0; y = x++; (A) 2, 1 (B) 2, 2 (C) 1, 1 (D) 1, 2

Last Answer : (A) 2, 1

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 : 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

Last Answer : b) 5 6 7 8

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 : 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 will be the output of the following Python code snippet? d1 = {"john":40, "peter":45} d2 = {"john":466, "peter":45} d1 > d2 a) True b) False c) Error d) None

Last Answer : Answer: c Explanation: Arithmetic > operator cannot be used with dictionaries.

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

Last Answer : Answer: b Explanation: If d2 was initialized as d2 = d1 the answer would be true.

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

Last Answer : Answer: a Explanation: In can be used to check if the key is int dictionary.

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 : State True or False. i) In spooling high speed device like a disk is interposed between running program and low-speed device in Input/output. ii) By using spooling for example instead of writing directly to a printer, ... ii-False B) i-True, ii-True C) i-False, ii-True D) i-False, ii-False

Last Answer : B) i-True, ii-True

Description : State True or False. 1. Term of reference is the final output of Feasibility Study 2. Design specification report is the final output of System Analysis A) 1-true, 2-true B) 1-false, 2-true C) 1-true, 2-false D) 1-false, 2-false

Last Answer : A) 1-true, 2-true

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 : Which of the following services is not provided by wireless access point in 802.11 WLAN? (A) Association (B) Disassociation (C) Error Correction (D) Integration

Last Answer : Answer: C Explanation: IEEE 802.11 Services

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