+ 2
Write a program which accepts a sequence of comma-separated numbers from console and generate a list and a tuple which contains
34,67,55,33,12,98 Then, the output should be: ['34', '67', '55', '33', '12', '98'] ('34', '67', '55', '33', '12', '98') Hints: In case of input data being supplied to the question, it should be assumed to be a console input. tuple() method can convert list to tuple
4 odpowiedzi
+ 2
me too, here my try: https://code.sololearn.com/cnRv3Z0LbxGJ/#py also I did that kind of conversion on: https://code.sololearn.com/WZKmo7mHodUK/#
+ 1
Not sure if this is correct but here's my try:
https://code.sololearn.com/cONsH6VYYgEu
+ 1
values = input("34,67,55,33,12,98")
list = values.split(",")
tuple = tuple(list)
print('List : ',list)
print('Tuple : ',tuple)
0
I'll do this when I got off work