fork download
  1. n='\n';f=lambda x,y:x+n+n.join(x[:-i]for i in range(1,len(x)-1))+n+n.join(y[:i]for i in range(1,len(y)+1))
  2.  
  3. print(f('hello','heaven'))
Success #stdin #stdout 0.01s 9992KB
stdin
Standard input is empty
stdout
hello
hell
hel
he
h
he
hea
heav
heave
heaven