How will you add these items to the already created empty dictionary? Suppose I want to have the following output:

17. How will you add these items to the already created empty dictionary? Suppose I want to have the following output:

{0: 'welcome', 2: 'to', 3: 'include help'}
  1. Dict[0] = 'welcome'
    Dict[2] = 'to'
  2. Dict[3] = 'include help'
    [0] = 'welcome'
    [2] = 'to'
    [3] = 'include help'
  3. Dict[0] = [0:'welcome']
    Dict[1] = [2:'to']
    Dict[2] =[3: 'include help']

Answer: A) Dict[0] = 'welcome'
Dict[2] = 'to'

Explanation:

Option A would be the correct syntax to add the elements.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.