Skip to content

Instantly share code, notes, and snippets.

@JakenHerman
Created February 13, 2014 17:23
Show Gist options
  • Save JakenHerman/8979686 to your computer and use it in GitHub Desktop.
Save JakenHerman/8979686 to your computer and use it in GitHub Desktop.
cigar_party in Coding Bat
__author__ = 'Jaken'
def cigar_party(cigars, is_weekend):
if is_weekend and cigars >= 40:
return True
elif is_weekend and cigars < 40:
return False
elif not is_weekend and cigars < 40 and cigars > 60:
return False
elif not is_weekend and cigars >= 40 and cigars <= 60:
return True
else:
return False
@Houssamt290
Copy link

Screenshot_20220213-001512_Pydroid 3
A shorter version 🤷🏻‍♂️

@vigskr15
Copy link

def cigar_party(cigars, is_weekend):
if is_weekend and 40<=cigars or 40<=cigars<=60:
return True
return False

one line logic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment