+ 2

Why does the join method in python return keys only when used on a dict?

myFriend = {"name": "Peter", "age": "16"} x = ', '.join(myFriend) print(x)

4th Aug 2020, 10:24 AM
Divine Darkey
Divine Darkey - avatar
2 odpowiedzi
+ 3
Såñtösh Màràvi thank you but not clear. I mean I still don't get it
4th Aug 2020, 10:43 AM
Divine Darkey
Divine Darkey - avatar
+ 2
Because key are only print in immutable order but values doesn't . That's why it join only key's .
4th Aug 2020, 10:28 AM
Sâñtôsh
Sâñtôsh - avatar