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 136 views
136 views asked Sep 21, 2017 by avibootz
1 answer 116 views
1 answer 136 views
1 answer 130 views
1 answer 229 views
1 answer 223 views
2 answers 235 views
235 views asked May 10, 2018 by avibootz
...