Python tuple program to convert a string into a tuple

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

Steps to solve the program
  1. Take a string as input.
  2. Now convert the string into a tuple using tuple().
  3. Print the output.
				
					str1 = "Sqatools"
print("String: ",str1)
tup = tuple(str1)
print("After converting string to a tuple: ",tup)
				
			

Output :

				
					String:  Sqatools
After converting string to a tuple:  ('S', 'q', 'a', 't', 'o', 'o', 'l', 's')
				
			

multiply all the elements in a tuple.

convert a tuple of string values to a tuple of integer values.

Leave a Comment