hmm... by using lambda functions and map() in python, we can find the sum without actually using a loop.
Here's my code: #!/usr/bin/python def f(item): return int(item); print sum(map(f,list(raw_input().strip()))) On 12/19/11, Bruno Oliveira <[email protected]> wrote: > I think it can be done via functional programming and by using lambda > functions and lists by comprehension > > -- > You received this message because you are subscribed to the Google Groups > "Google Code Jam" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-code?hl=en. > > -- Thanks and Regards Vikram Gaur Software Engineer Samsung Engineering Labs, Noida +91-9818540102 "Since human beings themselves are not fully debugged yet, there will be bugs in your code no matter what you do." - Chris Mason -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-code?hl=en.
