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

1 Answer

Answer :

c) Error

Related questions

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 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? 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 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 : 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 will be the output? d = {"john":40, "peter":45} print(list(d.keys())) a) [“john”, “peter”]. b) [“john”:40, “peter”:45]. c) (“john”, “peter”) d) (“john”:40, “peter”:45)

Last Answer : a) [“john”, “peter”].

Description : What is the output? d = {"john":40, "peter":45} d["john"] a) 40 b) 45 c) “john” d) “peter”

Last Answer : a) 40

Description : What will be the output? d = {"john":40, "peter":45} d["john"] a) 40 b) 45 c) “john” d) “peter”

Last Answer : a) 40

Description : Which of the following statements is TRUE? D1: The decomposition of the schema R(A,B,C) into R1(A,B) and R2(A,C) is always lossless. D2: The decomposition of the schema R(A,B,C,D,E) having AD→B, C→DE, B→AE, AE→C ... ,D,E) is lossless. (A) Both D1 and D2 (B) Neither D1 and D2 (C) Only D1 (D) Only D2

Last Answer : (D) Only D2

Description : Suppose d = {“john”:40, “peter”:45}. To obtain the number of entries in dictionary which command do we use? a) d.size() b) len(d) c) size(d) d) d.len()

Last Answer : b) len(d)

Description : Suppose d = {“john”:40, “peter”:45}, to delete the entry for “john” what command do we use a) d.delete(“john”:40) b) d.delete(“john”) c) del d[“john”]. d) del d(“john”:40)

Last Answer : c) del d[“john”].

Description : Read the code shown below carefully and pick out the keys? d = {"john":40, "peter":45} a) “john”, 40, 45, and “peter” b) “john” and “peter” c) 40 and 45 d) d = (40:”john”, 45:”peter”)

Last Answer : b) “john” and “peter”

Description : Which of the following statements create a dictionary? a) d = {} b) d = {“john”:40, “peter”:45} c) d = {40:”john”, 45:”peter”} d) All of the mentioned

Last Answer : d) All of the mentioned

Description : If D1, D2,…. Dn are domains in a relational model, then the relation is a table, which is a subset of (A) D1+D2+…. +Dn (B) D1x D2x… xDn (C) D1U D2U….UDn (D) D1- D2-….-Dn

Last Answer : (B) D1x D2x… xDn

Description : Consider the following database table having A, B, C and D as its four attributes and four possible candidate keys (I, II, III and IV) for this table: I: {B} II: {B, C} III: {A, D} IV: {C, D} If ... the database table? (A) I and III only (B) III and IV only (C) II only (D) I only

Last Answer : (C) II only

Description : What will be the output of the following Python code? d = {"john":40, "peter":45} d["john"] a) 40 b) 45 c) “john” d) “peter”

Last Answer : Answer: a Explanation: Execute in the shell to verify.

Description : What will be the output of the following Python code snippet? d = {"john":40, "peter":45} a) “john”, 40, 45, and “peter” b) “john” and “peter” c) 40 and 45 d) d = (40:”john”, 45:”peter”)

Last Answer : Answer: b Explanation: Dictionaries appear in the form of keys and values.

Description : Which of the following statements create a dictionary? a) d = {} b) d = {“john”:40, “peter”:45} c) d = {40:”john”, 45:”peter”} d) All of the mentioned

Last Answer : A

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 : A particle experiences constant acceleration for 20 seconds after starting from rest. If it travels a distance D1 in the first 10 seconds and distance D2 in the next 10 seconds then, (a) D2 = D1 (b) D2 = 2D1 (c) D2 = 3D1 (d) D2 = 4D1 -Science

Last Answer : (c) is the answer

Description : In a rhombus if d1 = 16 cm, d2 = 12 cm, then the length of the side of the rhombus is (a) 8 cm (b) 9 cm (c) 10 cm (d) 12 cm

Last Answer : (c) 10 cm

Description : A compound pipe of diameter d1, d2 and d3 having lengths l1, l2 and l3 is to be replaced by an equivalent pipe of uniform diameter d and of the same length (l) as that of the compound pipe. The size of the equivalent pipe is given by (A) l/d² = + + (B) l/d³ = + ) + (C) = + + (D)

Last Answer : Answer: Option D

Description : 18.The total extension of a taper rod of length ‘L’ and end diameters ‘D1’ and ‘D2’, subjected to a load (P), is given of a. 4PL/ΠE. D1D2 b. 3PL/ΠE. D1D2 c. 2PL/ΠE. D1D2 d. PL/ΠE.D1D2 Where E=Young’s modulus of elasticity

Last Answer : a. 4PL/ΠE. D1D2

Description : In the treatment of parkinsonism, bromocriptine differs from levodopa in the following respects except: A. It does not need conversion to an active metabolite B. It has a longer duration of ... with little/antagonistic action on D1 receptors D. It does not produce behavioral/psychiatric side effect

Last Answer : D. It does not produce behavioral/psychiatric side effects

Description : 6.12 The most prominent action of bromocriptine is: A. Dopamine D2 agonism B. Dopamine D2 antagonism C. Dopamine D1 antagonism D. α adrenergic antagonism

Last Answer : A. Dopamine D2 agonism

Description : Dopaminergic D1 and D2 as well as adrenergic α and β1, but not β2 receptors are activated by: A. Dopamine B. Dobutamine C. Methoxamine D. Phenylephrine

Last Answer : A. Dopamine

Description : Dopaminergic D1 and D2 as well as adrenergic α and β 1, but not β 2 receptors are activated by: A. Dopamine B. Dobutamine C. Methoxamine D. Phenylephrine

Last Answer : A. Dopamine

Description : Assume that D1 and D2 in figure are ideal diodes. The value of current I is A)0mA B) 0.25mA C) 0.5 mA D)1.0mA 

Last Answer : Assume that D1 and D2 in figure are ideal diodes. The value of current I is 0mA

Description : The age of Discontinuity‘ (1969) has been authored by A. John Drydon B. Cyril Debydeen C. Peter F. Drucker D. None of these

Last Answer : C. Peter F. Drucker

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 = 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 : 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 : 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 : 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 : 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 : 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 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 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 of the following? print("xyyzxyzxzxyy".count('xyy', -10, -1)) a) 2 b) 0 c) 1 d) error

Last Answer : b) 0

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? print("xyyzxyzxzxyy".count('yy')) a) 2 b) 0 Page No 23 c) error d) none of the mentioned

Last Answer : a) 2