Python tuple program to convert a tuple into a string

In this python tuple program, we will convert a tuple into a string.

Steps to solve the program
  1. Create a tuple having characters and create an empty string.
  2. Use for loop to iterate over characters in the tuples and add each character to the empty string.
  3. Print the output.
				
					tup = ('s','q','a','t','o','o','l','s')
str1 = ''
for char in tup:
    str1 += char
    
print("String: ",str1)
				
			

Output :

				
					String:  sqatools
				
			

add an item to a tuple.

get the 2nd element from the front and the 3rd element from the back of the tuple.

1 thought on “Python tuple program to convert a tuple into a string”

Leave a Comment