Answers for "dict python get only value as string"

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