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 228 views
228 views asked Sep 21, 2017 by avibootz
1 answer 220 views
1 answer 231 views
1 answer 222 views
1 answer 324 views
1 answer 318 views
2 answers 349 views
349 views asked May 10, 2018 by avibootz
...