Can somebody please explain to me about this line : '\n'.join([f"{n} x {i} = {n*i}" for i in range(1,11)?
22:07 23 Feb 2021
n= int(input())
print('\n'.join([f"{n} x {i} = {n*i}" for i in range(1,11)]))

and why can't I write like below?

n= int(input())
for i in range(1,11):
    x = ["{} * {} = {}".format(n,i,(n*i))]
print('\n'.join(x))
python python-3.x