Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

howto print list without brackets and comma python

Tags:

python

ISBN = [int(e) for e in input("input ISBN :")]
sum = 10*ISBN[0]+9*ISBN[1]+8*ISBN[2]+7*ISBN[3]+6*ISBN[4]+5*ISBN[5]+4*ISBN[6]+3*ISBN[7]+2*ISBN[8]
for i in range(0,10):
    sum_check = sum + i
    if sum_check % 11 ==0: 
      print("n10 =",i)
       ISBN.append(i)

OUTPUT

n10 = 5
[0, 2, 0, 1, 3, 1, 4, 5, 2, 5]

but i want this output

020134525

like image 794
chatchai seeda Avatar asked Dec 21 '25 01:12

chatchai seeda


1 Answers

To print any list in python without spaces, commas and brackets simply do

print(*list_name,sep='')
like image 91
Nikita Agarwala Avatar answered Dec 23 '25 15:12

Nikita Agarwala



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!