• + 4 comments

    You can print this without using join. Print has a built in way of doing this. When you pass multiple values to print, it will print them space-separated by default. You can set the separator to be anything you want, for example to be newline "\n". Using the splat operator will pass a list as multiple arguments:

    print( *['%d x %d = %d'%(n, i, n*i) for i in range(1, 11)], sep="\n" )