List and Tuple Both are datatypes in Python .These are similar to each other and used to store data of different types.But the only difference in list and tuple is that we can edit data in list but we can not edit data in tuple
For Example:
List =['76','23','25','85']
Tuple=('75','6','7')
Question: | |
Write a program which accepts a sequence of comma-separated numbers from console and generate a list and a tuple which contains every number. | |
Suppose the following input is supplied to the program: | |
34,67,55,33,12,98 | |
Then, the output should be: | |
['34', '67', '55', '33', '12', '98'] | |
('34', '67', '55', '33', '12', '98') |
Code::