P
P
PaffosONE2021-08-13 01:06:43
Python
PaffosONE, 2021-08-13 01:06:43

Working with tuple how to do?

Good evening, I ran into such a problem
, I have a values ​​variable, of the tuple type, when I try to transfer a string to it, it is divided into letters.

Code:

values = ('SimpleText')
values = tuple( values )
print( values )

Output:
('S', 'i', 'm', 'p', 'l', 'e', 'T', 'e', 'x', 't')

How can I solve this problem in a couple of lines, so that instead of dividing the text into characters, there would be a whole text?
I apologize in advance for a possibly stupid question on my part!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shurshur, 2021-08-13
@PaffosONE

Add magic comma:
values=('SimpleText',)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question