Salesforce Interview Question

String manipulation, factorial in python