Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

' How many different strategies did you find?

Answered: 1 week ago