I need to concatenate string to an existing one as follows.
for k,v in r.iteritems():
tableGenString += "%s %s, " % (k, what_type(v))
The problem is that for the last item the comma(',') should not be added.
How can I check if k,v is the last item?
Added
The example is a simplified version of the real code as follows.
for k,v in r.iteritems():
filteredKey = m.mapper(k)
(typestring, valuestring) = what_type(v)
tableGenString += "%s %s, " % (k, typestring)
string1 += "%s, " % k
string2 += "%s, " % valuestring
I need to check the last item for this case.