why isn’t the key values of “name”,“lastname”,“marks” in the previous dictionary example automatically added?
Iterable object in dictionary
when we perform any operation on a dictionary that we can perform on lists, python considers the keys as the default. So when we do “.”.join(d) it works on the keys of the dictionary. I hope you understand this. Please feel free if you still have any confusion.
Happy Coding !!
What happens in the case of say:
d = {“name”: “user”, “marks”: 80}
the keys aren’t added(concatenated) in this case?
if you are doing join operation with “.” then the output will be ‘name.marks’
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.