May-13-2019, 09:20 PM
I thought that this would be really easy but I'm having problems.
I want to print a list and add the word "and" before the last value
I tried with the .join method:
list=['a','b','c','d']
x=', '
print(x.join(list)))
This worked to print the list values as a string but I have no way to add the word "and".
How should I do this?
Thanks a lot
Shevach
I want to print a list and add the word "and" before the last value
I tried with the .join method:
list=['a','b','c','d']
x=', '
print(x.join(list)))
This worked to print the list values as a string but I have no way to add the word "and".
How should I do this?
Thanks a lot
Shevach