string to tuple python

string = "mystring"
tuple1 = tuple(string)
# ('m', 'y', ' ', 's', 't', 'r', 'i', 'n', 'g')

tuple2 = string,
# ("my string",)

Here is what the above code is Doing:
1. The first line creates a tuple from a string.
2. The second line creates a tuple from a string, but the comma at the end of the string is important.
Without the comma, the interpreter will think that you’re trying to create a tuple from a string and a variable.
The comma tells the interpreter that you’re trying to create a tuple from a string.