Skip to content

Instantly share code, notes, and snippets.

@iamshanto
Created May 18, 2013 15:32
Show Gist options
  • Save iamshanto/5604828 to your computer and use it in GitHub Desktop.
Save iamshanto/5604828 to your computer and use it in GitHub Desktop.
# Require python 2.6
import math
f = open('input.txt')
output = ''
for line in f:
value = math.factorial(int(line))
output += line.strip() + " -> " + str(value).replace("0", "")[-1]+"\n"
writeFile = open('output.txt', 'w+')
writeFile.write(output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment