Print list without space in i python-notebook -


a="alizafar"  b=len(a)  lis=[1]*b  d=b  sep=""  c=0  while b>0:      lis[c]=a[c]      c=c+1      b=b-1  c=0  while d>0:      new=lis[c]      print new,      c=c+1      d=d-1 

result: l z f r

while want print: alizafar

you can use sys.stdout.write instead of print

import sys a="alizafar"  b=len(a)  lis=[1]*b  d=b  sep=""  c=0  while b>0:      lis[c]=a[c]      c=c+1      b=b-1  c=0  while d>0:      new=lis[c]      sys.stdout.write(new)      c=c+1      d=d-1 

will print out

alizafar 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -