From the given syntax, which of the following is the correct syntax to create a dictionary?

6. From the given syntax, which of the following is the correct syntax to create a dictionary?

  1. Dict=[ 1:"hi",2:"hello"]
  2. Dict={ 1:"hi",2:"hello"}
  3. Dict={ 1:"hi",2:"hello"}
  4. Dict=[ 1:"hi",2:"hello"]

Answer: C) Dict={ 1:"hi",2:"hello"}

Explanation:

Dict={1:"hi",2:"hello"} is the correct syntax to create a dictionary, where 1 and 2 are the unique keys and HI and HELLO are the pairs.

Comments and Discussions!

Load comments ↻






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