Created
March 28, 2021 00:27
-
-
Save simon-saliba/10af2d553f32a05308dc045cc3b81cff to your computer and use it in GitHub Desktop.
String Calculator Mock Logging Test Pass
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
import logging | |
def add(str): | |
if(len(str) == 0) : | |
logging.info(0) | |
return 0 | |
else: | |
numbers_str = [] | |
numbers_comma_split = str.split(',') | |
sum_result = 0 | |
for i in range(len(numbers_comma_split)): | |
sum_result = sum_result + numbers_comma_split[i] | |
logging.info(sum_result) | |
return sum_result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment