Home »
Python »
Python Dictionary MCQs
From the following given syntax, which of them is the correct syntax to make a dictionary using the dict () inbuilt function?
10. From the following given syntax, which of them is the correct syntax to make a dictionary using the dict () inbuilt function?
- Dict = dict{1: 'hello', 2: 'everyone'}
- Dict = dict(1: 'hello', 2: 'everyone')
- Dict = dict({1: 'hello', 2: 'everyone'})
Answer: C) Dict = dict({1: 'hello', 2: 'everyone'})
Explanation:
Dict = dict({1: 'hello', 2: 'everyone'}) is the correct syntax to make a dictionary using dict() inbuilt function.