I want, when i for loop, there will be comma in the end of each item except the last item, last item should be dot
x = ['df', 'second', 'something', 'another']
separator = ''
for i in x:
r = i
print(r, separator)
separator = ','
else:
separator = '.'
this is my current code.
My expected result should be like this below:
df,
second ,
something ,
another.
can anyone help me in this case?
,afterdf? Can you explain detail rules?