1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Evgesh-ka [11]
3 years ago
7

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
Computers and Technology
1 answer:
MAXImum [283]3 years ago
7 0

Answer:

Following are the program can be defined as follows:

def print_popcorn_time(bag_ounces):#defining a method print_popcorn_time  

#defining a conditional statement  

   if bag_ounces < 3: #check value if bag_ounces is less then 3

       print("Too small") #print message

   elif bag_ounces > 10: # check another condition that bag_ounces is greater then 10

       print("Tool large") #print message  

   else: # else part

       bag_ounces = bag_ounces * 6 # multiply the bag_ounces value by 6  

       print(bag_ounces,"second") #print message

print_popcorn_time(2) # method calling

Output:

Too small

Explanation:

In the above program, a method "print_popcorn_time" is declared, which accepts a parameter, that is  "bag_ounces", inside the method, a conditional statement is used, which can be described as follows:

  • In the condition statement first, if block is used, that check variable "bag_ounces" value is less then 3, if this condition is true, it will print a message, that is "Too small", otherwise it will go to elif block.
  • In this block, it will check the variable "bag_ounces" value is greater then 10, if this condition is true, it will print a message, that is "Too large".
  • If both the above conditions are false so, it will go to else block, in this block variable "bag_ounces" value is multiplied by 6, and prints its value in seconds.
You might be interested in
Which of the following transferable skills are generally the most look for in the it <br> field
kherson [118]

Answer:

mechanical, encryptions, communication, network admin, leadership, and teambuilding

Explanation:

6 0
3 years ago
How do I give Brainliest? Will give brainliest when I figure out how
Lina20 [59]
When somebody writes the answer for your question and posts it on your question it will show a “(crown)mark as brainliest” in blue. click it and it’ll turn yellow and mark the person the brainliest for your question
7 0
3 years ago
Read 2 more answers
Explain the principles of computer applications ​
9966 [12]

Answer:

The nature of computers and code, what they can and cannot do.

How computer hardware works: chips, cpu, memory, disk.

Necessary jargon: bits, bytes, megabytes, gigabytes.

How software works: what is a program, what is "running"

How digital images work.

Computer code: loops and logic.

Big ideas: abstraction, logic, bugs.

3 0
3 years ago
Ill give 100 points to whoever gives me the CORRECT answer. I keep getting syntax errors when I do the "add:" part. Can someone
Olin [163]

Answer:

sorry but there is not enough information to complete this

Explanation:

6 0
3 years ago
Read 2 more answers
To change the backround color of a page, which tab would you use?
ivann1987 [24]
I have concluded the answer is a
4 0
4 years ago
Read 2 more answers
Other questions:
  • What tool listed below will be the most useful for developing presentation content?
    10·2 answers
  • You have been asked to write a program that will ask the user for his or her pizza order and display it. The order will include
    11·1 answer
  • Rate is how fast a screen updates the information being displayed.
    6·2 answers
  • Monica is teaching herself to paint. What web resource would be the most helpful
    14·1 answer
  • How are modern computers different from eniac?
    5·1 answer
  • the technique of blocking some parts of a photograph to emphasize (or draw attention to) another part of the same photograph is
    8·1 answer
  • Hey system has defined specific Quetion that describe how signals are sent over connections. Which layer of the transmission con
    11·1 answer
  • The system where the unit of measurement is centimeter
    15·1 answer
  • Is anyone a robIox moderator?
    13·2 answers
  • What happens when you restrict someone on messenger?.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!