Created
June 13, 2020 09:47
-
-
Save dipta007/6530908867982d697d82a2d5635248f2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# 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