Question:medium

Identify the invalid Python statement from the following:

Show Hint

To initialize an empty dictionary, use dict()} or \{\}}. Avoid mixing the two syntax forms.
Updated On: Jan 13, 2026
  • d = dict()
     

  • e = {}
     

  • f = [] 
     

  • g = dict{} 
     

Show Solution

The Correct Option is D

Solution and Explanation

The statement g = dict{} is invalid. The dict() function does not accept curly braces {} as an argument. To initialize an empty dictionary, use either g = dict() or g = {}. Other provided options correctly initialize dictionaries or lists.

Was this answer helpful?
0

Top Questions on Commands and Requests