Skip to main content
2 of 3
Commonmark migration

05AB1E, 4 bytes (non-competing)

Since the language postdates the challenge, this is non-competing

Code:

L0KP

Explanation:

L     # Create the list [1, ..., input]
 0K   # Remove all occurencies of zero
   P  # Calculate the product

I have no idea why this works for 0, but it does.

Adnan
  • 44.5k
  • 6
  • 82
  • 246