In: Computer Science
We are having a party with amounts of tea and candy. Print the outcome of the party as "Bad Party", "Good Party", or "Great Party". A party is good if both tea and candy are at least 5. However, if either tea or candy is at least double the amount of the other one, the party is great. However, in all cases, if either tea or candy is less than 5, the party is always bad. Write the function:
Examples:
tea: 6, candy: 6 -> "Good Party"
tea: 3, candy: 8 -> "Bad Party"
tea: 20, candy: 6 -> "Great Party"
code:
def party(tea,candy):
if(tea<5 or candy<5):
print("Bad Party")
elif(tea>=2*candy or candy>=2*tea):
print("Great Party")
else:
print("Good Party")
if you have some other cases please comment then i will execute those cases and post the screenshots of them
thankyou