Created
December 14, 2017 17:30
-
-
Save mrcat323/00a52f8fd13aa8b9c0ed62af0a5df788 to your computer and use it in GitHub Desktop.
Sums of digits
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Function of sums of digits | |
def solve(a,b,c): | |
d=a*b+c | |
result=list(map(int,str(d)) | |
return sum(result) | |
# The result will be "2" | |
print(solve(10,10,10)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment