107k views
5 votes
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. Example output for bag_ounces = 7

User Gvalkov
by
3.3k points

1 Answer

6 votes

Answer:

def print_popcorn_time(bag_ounces):

if bag_ounces<3:

print("Too small")

elif bag_ounces>10:

print("Too large")

else:

bag_ounces = bag_ounces*6

print("%s seconds" % bag_ounces)

user_ounces = int(input())

print_popcorn_time(user_ounces)

Step-by-step explanation:

Formatting was wrong on all other answers.

User Stephen Turner
by
3.7k points