Input : [12,13,14,15]
O/p : 12,13,14,15
O/p should be int
Any suggestions on how to i/p a list of integers and get the o/p as integers but without the square braces?
Input : [12,13,14,15]
O/p : 12,13,14,15
O/p should be int
Any suggestions on how to i/p a list of integers and get the o/p as integers but without the square braces?
The simplest way to this is to use "*" in print and using separator as ",".
The default separator is " " (Space).
lst = [12,13,14,15]
print(*lst,sep=",")
if you want in one string
l=[12,13,14,15]
print(','.join(l))
OR
l=[12,13,14,15]
for i in l[:-1]:
print(i,end=',')
print(l[-1])
However while printing data type does not matter
Your question is not really clear about the output, but if you want a string as output, you can do like this :
lst = [12,13,14,15]
str1 = ''.join(str(e)+',' for e in lst)
l = len(str1)-1
str1 = str1[:l]
then you can do what you want with str1
(print it ect...)