🔍
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
0 like 0 dislike

1 Answer

Answer: c Explanation: Arithmetic > operator cannot be used with dictionaries.
0 like 0 dislike

Related questions

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
Answer : Answer: b Explanation: If d2 was initialized as d2 = d1 the answer would be true....

View solution
0 like 0 dislike
1 answer

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
Answer : Answer: a Explanation: In can be used to check if the key is int dictionary....

View solution
0 like 0 dislike
1 answer

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
Answer : c) Error...

View solution
0 like 0 dislike
1 answer

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
Answer : b) False...

View solution
0 like 0 dislike
1 answer

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”)
Answer : Answer: b Explanation: Dictionaries appear in the form of keys and values....

View solution
0 like 0 dislike
1 answer

50.5k questions

47.1k answers

240 comments

7.0k users