I'm trying to take a list of terms and output them in a specific format.
For example, I have a list of verbs:
verbs = ['eat', 'run', 'jump', 'play', 'walk', 'talk', 'send']
and I want my output to be a string, where each item in the list is also a string, delineated by a |
magic(verbs)
output:
"eat" | "run" | "jump" | etc.
I've tried using the .join method, but that just gives me one big string of the terms separated by pipes, instead of what I want. Any ideas? I'm pretty new to Python and I'm sorry if this is incredibly low-brow or something that has been answered elsewhere.
.join()to join them with a pipe.