Python tuple program to concatenate two tuples

In this python tuple program, we will concatenate two tuples.

Steps to solve the program
  1. Take two tuples as input.
  2. Concatenate the two tuples using the ” operator.
  3. Print the output.
				
					tup1 = ('s','q','a')
tup2 = ('t','o','o','l')
print(f"Original tuple: {tup1} {tup2}")
result = tup1+tup2
print("Combined tuple: ",result)
				
			

Output :

				
					Original tuple: ('s', 'q', 'a') ('t', 'o', 'o', 'l')
Combined tuple:  ('s', 'q', 'a', 't', 'o', 'o', 'l')
				
			

sort a list of tuples by the minimum value of a tuple.

order tuples by external list.

Leave a Comment