[Solved] How removing commas in a list with strings, write in one line of code [duplicate]

[ad_1]

The Best answer is from Yousaf .

x = [“apple”, “banana”, “carrot”, “cheese”, “pear”]

print(“\””+’s ‘.join(x[:-1])+”s”+” and “+(x[4])+”s”+”\””)

[ad_2]

solved How removing commas in a list with strings, write in one line of code [duplicate]