Skip to content

Instantly share code, notes, and snippets.

@simon-saliba
Created March 27, 2021 22:23
Show Gist options
  • Save simon-saliba/12e3b61390c9941e9f874c131ece9129 to your computer and use it in GitHub Desktop.
Save simon-saliba/12e3b61390c9941e9f874c131ece9129 to your computer and use it in GitHub Desktop.
Refractoring Pass 3
def add(str):
if(len(str) == 0) : return 0
else:
numbers_comma_split = str.split(',')
if(len(numbers_comma_split) == 1) : return int(str)
else:
return numbers_comma_split[0] + numbers_comma_split[1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment