I have a list in Python e.g.
names = [\"Sam\", \"Peter\", \"James\", \"Julian\", \"Ann\"]
I want to print the array in a single line withou
You need to loop through the list and use end=" "to keep it on one line
end=" "
names = ["Sam", "Peter", "James", "Julian", "Ann"] index=0 for name in names: print(names[index], end=", ") index += 1