In this python tuple program, we will convert a string into a tuple.
Steps to solve the program
- Take a string as input.
- Now convert the string into a tuple using tuple().
- 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')