fork download
  1. def x(n):
  2. a = 1
  3. for i in range(1, n+1):
  4. a = a * (i - 1) + i
  5. return a
  6.  
  7. # Assuming the input for n will be given here
  8. n = int(input("Enter a number: "))
  9. result = x(n)
  10. print(result)
  11.  
Runtime error #stdin #stdout #stderr 0.15s 25784KB
stdin
Standard input is empty
stdout
Enter a number: 
stderr
Traceback (most recent call last):
  File "./prog.py", line 8, in <module>
EOFError: EOF when reading a line