Skip to content

Instantly share code, notes, and snippets.

@simon-saliba
Created March 28, 2021 00:27
Show Gist options
  • Save simon-saliba/10af2d553f32a05308dc045cc3b81cff to your computer and use it in GitHub Desktop.
Save simon-saliba/10af2d553f32a05308dc045cc3b81cff to your computer and use it in GitHub Desktop.
String Calculator Mock Logging Test Pass
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