I have some object.ID-s which I try to store in the user session as tuple. When I add first one it works but tuple looks like (u\'2\',) but when I try to add ne
(u\'2\',)
Bottom line, the easiest way to append to a tuple is to enclose the element being added with parentheses and a comma.
t = ('a', 4, 'string') t = t + (5.0,) print(t) out: ('a', 4, 'string', 5.0)