Back

Python dictionaries

Created 1 year ago
86 Views
2 Comments
DhruvAd1XKz
@DhruvAd1XKz
DhruvAd1XKz
@DhruvAd1XKzProfile is locked. Login

What is the difference between the following commands?

x=dictt.get("key variable");

print(x);

and

x=dictt["key variable"];

print(x);

If both of them provide same output, then why is the '.get' function is added separately?

Comments (2)
Please login to comment.