Skip to main content
2 of 2
added 53 characters in body
Cyoce
  • 3.4k
  • 26
  • 29

PlatyPar, 8 bytes

c?1,_p\1 

Try it online!

Explanation:

c? ## if (n != 0) 1,_p ## product [1..n] \ ## else 1 ## 1 
Cyoce
  • 3.4k
  • 26
  • 29