I have this tuple: (1, 0, 0, 2)
and i want a string like: 0 0 2 (without the first number)
how can I do this?
your_tuple = (1, 0, 0, 2) result = ' '.join([str(v) for v in your_tuple[1:]])
An array of elements in the tuple excluding the first element is created and then joined by a space. The array should have string elements. Hence str(v) is to be applied.
str(v)
You can do this:
your_tuple = (1, 0, 0, 2) your_string = ' '.join(map(str, your_tuple[1:]))