Question: Write a Python program which accepts a sequence of comma-separated numbers from user and generate a list and a tuple with those numbers Sample data:

 Write a Python program which accepts a sequence of comma-separated numbers

Write a Python program which accepts a sequence of comma-separated numbers from user and generate a list and a tuple with those numbers Sample data: 3,5,7,23 Python list: A list is a container which holds comma separated values (items or elements) between square brackets where items or elements need not all have the same type in general, we can define a list as an object that contains multiple data items (elements). The contents of a list can be changed during program execution. The size of a list can also change during execution, as elements are added or removed from it Python tuple A tuple is container which holds a series of comma separated values (items or elements) between parentheses such as an (x, ) co- ordinate. Tuples are like lists, except they are immutable (e, you cannot change its content once created) and can hold mix data types Input some comma separated numbers 3,57.23 List 13,5,7, 231 Tuple (355.7. 23) LAR ACTIVITY 3.13.1 Week 3 Programming CSV to a list and tuple 0/1 main.py 1 -input"enter the values :") 2 listi-split. 3 tup-tuple(listi) 4 print("list - 0 formatlisti) 5 printtuple - 0.format(tup) 6 7

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!