I have file.txt containing two lines :
this is one
and my pen
Output should be like print each colum of every line in single row :
tahnids imsy opneen
How can we print this output in Python?
I tried the following but I'm stuck on jumping between alternate characters in each line. I'm looking for a generic solution whether one line or two line or more.
file=open('file.txt','r')
list1=[x.rstrip('\n') for x in file]
for i in list1:
n=len(i)
c=0
while c<n:
print(i[c],end=" ")
c=c+1
break
This it is printing only "ta".