Python tuple program to convert a tuple to string datatype

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

Steps to solve the program
  1. Take a tuple input.
  2. Convert the tuple to a string datatype using str().
  3. Print the output.
				
					tup = (4,1,7,5)
print("Original tuple: ",tup)
tup1 = str(tup)
print("After converting to a string: ",tup1)
print("Type of new tuple: ",type(tup1))
				
			

Output :

				
					Original tuple:  (4, 1, 7, 5)
After converting to a string:  (4, 1, 7, 5)
Type of new tuple:  <class 'str'>
				
			

test whether a tuple is distinct or not.

remove empty tuples from a list of tuples.

Leave a Comment