Is it possible to have a tuple contain only one tuple without the comma?
Question:
Can I have a tuple that contains just one tuple (without any additional commas) like the following:
((0,1))
I know that if I do the following, this works (kind of):
final_tuple = ()
input_tuple = (0,1)
final_tuple = ((input_tuple,))
print(str(final_tuple))
Output: ((0,1),)
Answers:
((0, 1),)
may be what you want.
Can I have a tuple that contains just one tuple (without any additional commas) like the following:
((0,1))
I know that if I do the following, this works (kind of):
final_tuple = ()
input_tuple = (0,1)
final_tuple = ((input_tuple,))
print(str(final_tuple))
Output: ((0,1),)
((0, 1),)
may be what you want.