Skip to content

Instantly share code, notes, and snippets.

@solen003
Created July 15, 2018 14:05
Show Gist options
  • Save solen003/4d294ee5c39b175dabb16299096ae986 to your computer and use it in GitHub Desktop.
Save solen003/4d294ee5c39b175dabb16299096ae986 to your computer and use it in GitHub Desktop.
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')
numbers = input("Type in numbers seperated only by a comma :")
numbers_split = numbers.split(',')
number_tuple = tuple(numbers_split)
print(number_tuple)
print(numbers_split)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment