Skip to content

Commit d8184e9

Browse files
committed
solution for problem-4
1 parent c9ce090 commit d8184e9

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

solution4.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
'''
2+
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:
3+
4+
34,67,55,33,12,98
5+
Then, the output should be:
6+
7+
['34', '67', '55', '33', '12', '98']
8+
('34', '67', '55', '33', '12', '98')
9+
'''
10+
11+
import sys
12+
13+
str = sys.argv[1]
14+
15+
arg_list = str.split(',')
16+
print(arg_list)
17+
18+
arg_tuple = tuple(arg_list)
19+
print(arg_tuple)

0 commit comments

Comments
 (0)