Skip to content

Instantly share code, notes, and snippets.

@dipta007
Created June 13, 2020 09:47
Show Gist options
  • Save dipta007/6530908867982d697d82a2d5635248f2 to your computer and use it in GitHub Desktop.
Save dipta007/6530908867982d697d82a2d5635248f2 to your computer and use it in GitHub Desktop.
# Ugly Code
def set(var, val):
if var not in mp:
return False
mp[var] = val
return True
if set(count, 1):
pass
# Clean Code
def check(var):
return var in mp
def set(var, val):
mp[var] = val
if check(count):
set(count, 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment