Answers for "python string from tuple"

2

convert a tuple into string python

tuple_ = 1, 2, 3, 4, 5
str(list(tuple))
Posted by: Guest on June-30-2020
4

python string to tuple

l = list('abcd')  	        # ['a', 'b', 'c', 'd']
l = map(None, 'abcd')       # ['a', 'b', 'c', 'd']
l = [i for i in 'abcd']	    # ['a', 'b', 'c', 'd']

import re               # importing regular expression module
l = re.findall('.', 'abcd')
print(l)                	# ['a', 'b', 'c', 'd']
Posted by: Guest on May-13-2021

Python Answers by Framework

Browse Popular Code Answers by Language