Created
November 25, 2021 22:44
-
-
Save Pratik-Shukla-22/6ae251e2ca588f766ec494ecd6ee86b9 to your computer and use it in GitHub Desktop.
This file contains 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
#Python code for squirrels cigar party problem | |
def cigar_party(cigars, is_weekend): | |
#If it's a weekend | |
if(is_weekend): | |
#If number of cigars >=40 | |
if(cigars>=40): | |
return True | |
#If it's not a weekend | |
else: | |
#If number of cigars are between 40 and 60 inclusive | |
if(cigars>=40 and cigars<=60): | |
return True | |
#If all the above cases are False | |
return False | |
#Function call | |
cigars = 20 | |
is_weekend = False | |
answer = cigar_party(cigars, is_weekend) | |
print(f"With the given conditions the final answer is {answer}.") | |
###################### Output ###################### | |
#With the given conditions the final answer is False. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment