import time a = "Hard" b = "Times" def foo(a,b,c,d,depth): time.sleep(2) print(a,b,c,d,depth) if (depth == 3): time.sleep(1) return a + b + c +d return foo(a,b, a[depth], b[depth], depth+1) x = foo(a,b,a,b,0) print(x)