For e.g. user input:
4,7,5,33,2,8
should give output like this:
['4', '7', '5', '33', '2', '8'] ('4', '7', '5', '33', '2', '8')
So far i have this:
x = input()
z = x.split()
y = tuple(z)
print(z, y)
why there is extra , in the end of tuple?
('...')is just wrappedstr.('...',)istupleofstr.x.split()is splitting the string by white spaces. You should usex.split(',').('12,56,48,86',)is tuple containing one element....this('4', '7', '5', '33', '2', '8')is tuple containing 5 elements.