Question

In: Computer Science

We are having a party with amounts of tea and candy. Print the outcome of the...

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"

Solutions

Expert Solution

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


Related Solutions

Historiy. Compare and contrast the origins and growth of the modern-day Tea Party movement with those...
Historiy. Compare and contrast the origins and growth of the modern-day Tea Party movement with those of the Populist Party. Familiarize yourself with the conditions associated with each party.
What is the outcome of having tighter integration within the supply chain?
What is the outcome of having tighter integration within the supply chain?
Provide an example of a third party benefiting from a prisoner’s dilemma outcome while the game...
Provide an example of a third party benefiting from a prisoner’s dilemma outcome while the game participants are worse off relative to other possible outcomes. Also, explain the nature of the benefit. How can a repeated game help in resolving a prisoner’s dilemma outcome? Why is game theory important to economics?
which process of drug therapy indicates that the patient is having a beneficial therapeutic outcome
which process of drug therapy indicates that the patient is having a beneficial therapeutic outcome
2,006 persons are cross classified by disease and exposure. Our outcome of interest is having the...
2,006 persons are cross classified by disease and exposure. Our outcome of interest is having the disease. Use the following 2 x 2 table to answer questions below. Disease No Disease Exposed 9 992 Not Exposed 16 989 a. What percent of people have disease? b. What percent of the exposed persons have disease? c. What is the odds of disease among the exposed? d. What is the odds of disease among the unexposed? e. What is the odds ratio...
1. what are the consequences of the united states having a two party system rather than...
1. what are the consequences of the united states having a two party system rather than a multi party system? what aspects of the U.S political system explain why the US has two party system? 2. Who determines ballotg acces in the American states? why this a relavent concern and what are the consequances? 3. on the heals of the 2016 presidential election, we are seeing much discussion of the role internet and socail media in voter education. what are...
Emma's cousin Jack is having a birthday party in a few weeks. Her whole family is...
Emma's cousin Jack is having a birthday party in a few weeks. Her whole family is planning on going and everyone has bought Jack a present apart from Emma. It is his 10th birthday and the families want to make it memorable as they always do for milestone birthdays. Emma has never been close with Jack and asked her brother Simon for advice as Simon and Jack are best friends. Emma was thinking of buying him a gift card so...
After having initially started out in 1988 as a reseller of third party software to small...
After having initially started out in 1988 as a reseller of third party software to small distribution businesses and corporate systems for retail home offices, by 1993 Datavantage grew to 16 employees and $1.5 million in sales with only $50,000 of external financing. Very few products were developed internally and, by 1993, Datavantage was slowly transforming itself into a consulting company. Despite relative success, it wasn’t exactly what Marvin envisioned to be an exciting entrepreneurial opportunity and he was ready...
After having initially started out in 1988 as a reseller of third party software to small...
After having initially started out in 1988 as a reseller of third party software to small distribution businesses and corporate systems for retail home offices, by 1993 Datavantage grew to 16 employees and $1.5 million in sales with only $50,000 of external financing. Very few products were developed internally and, by 1993, Datavantage was slowly transforming itself into a consulting company. Despite relative success, it wasn’t exactly what Marvin envisioned to be an exciting entrepreneurial opportunity and he was ready...
Suppose we are studying the market for beer; the market for candy is perfectly competitive. There...
Suppose we are studying the market for beer; the market for candy is perfectly competitive. There are two types of firms that produce beer, Type A firms and Type B firms. The cost curve of type A firm is represented by CA(y) = y^2 + 5, and the cost curve of a type B firm is represented by CB(y) = ((y^2) / 2 ) + 10. In the short-run, there are 10 Type A firms in the market, and 15...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT