# using while-loop to calculate n! (factorial of n) n = 5 x = 1 i = 1 while i <= n: x = x * i i = i + 1 print (x)