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 225 views
225 views asked Sep 21, 2017 by avibootz
1 answer 217 views
1 answer 228 views
1 answer 221 views
1 answer 319 views
1 answer 315 views
2 answers 346 views
346 views asked May 10, 2018 by avibootz
...