In: Computer Science
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'] and ('34',67', '55', '33', '12', '98').
CODE: Python Programming Language
# Takihng comma separated values from the console
input_values = input()
# Generate list
lst = input_values.split(",")
# Generate tuple
tup = tuple(lst)
# Printing list
print(lst)
# Printing tuple
print(tup)
====================================================================
SCREENSHOT OF THE CODE:
====================================================================
OUTPUT:
Thank you. Please ask me if you have any doubt.