Q. How is del D and del D[<key>] different from one another if D is a dictionary?


Answer =

Del D delete the all dictionary or delete the value of D . So that when we want to find the value of D then it will give error that D is not defined.
While del D[<key>] delete the particular key which is given by user.

7 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

  1. It is correct thanks

    ReplyDelete
    Replies
    1. If we give del D[]
      Won't the particular key-value pair will be deleted?.
      I'm saying because they said particular key only will delete.

      Delete
    2. I meant del [ ] of key

      Delete

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post