How to converte string to tuple in Python

1 Answer

0 votes
s = 'python'

t = tuple(s)

print(t)


'''
run:

('p', 'y', 't', 'h', 'o', 'n')

'''

 



answered Sep 21, 2017 by avibootz

Related questions

1 answer 221 views
221 views asked Sep 21, 2017 by avibootz
1 answer 213 views
1 answer 225 views
1 answer 214 views
1 answer 314 views
1 answer 311 views
2 answers 342 views
342 views asked May 10, 2018 by avibootz
...