Define function print_popcorn_time() with parameter bag_ounces. If bag_ounces is less than 3, print "Too small". If greater than 10, print "Too large". Otherwise, compute and print 6 * bag_ounces followed by "seconds". End with a newline. Remember that print() automatically adds a newline.

Respuesta :

Answer:

In Python:

def print_popcorn_time(bag_ounces):

   if bag_ounces < 3:

       print("Too small")

   if bag_ounces > 10:

       print("Too large")

   else:

       print(str(6 * bag_ounces)+" seconds")

       

Explanation:

This defines the function

def print_popcorn_time(bag_ounces):

This checks if bag_ounces < 3

   if bag_ounces < 3:

If yes, it prints too small

       print("Too small")

This checks if bag_ounces > 10

   if bag_ounces > 10:

If yes, it prints too big

       print("Too large")

If otherwise,

   else:

Multiply bag_ounces by 6 and print the outcome

       print(str(6 * bag_ounces)+" seconds")

ACCESS MORE
EDU ACCESS