Answers for "python dict key to string"

6

convert dict to string python

my_dict = {"Hello" : True, "World" : False}
print(str(my_dict))
Posted by: Guest on December-01-2020
0

python dict keys to string

myList = ['Tom', 'Lisa', 'Chris', 'Joe']
separator = ' and ' # note the spaces around

s = separator.join(myList)

print(s)

## outputs:
## Tom and Lisa and Chris and Joe
Posted by: Guest on August-16-2020

Python Answers by Framework

Browse Popular Code Answers by Language