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?
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?