• Python question of the day

    What would be the output of executing the following code:
    d, e, f = {}, dict(), dict(())
    d['one'] = 1.0; d['two'] = 2.0; d['three'] = 3.0
    e = dict([('two', 2/1), ('three', 3/1), ('one', 1/1)])
    f = dict(zip(['three', 'one', 'two'], [3, 1, 2]))
    print(d == e and e == f and d == f)
     True
     False
     1
     SyntaxError
    Explanation:
    In python, dictionary is an unordered collection and as long as the key-value pairs are matching, they are all same irrespective of the order


    Top 100 python interview questions:


datai analytics