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
Nataly [62]
3 years ago
5

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. Sample output with input: 7 42 seconds
Computers and Technology
1 answer:
Lynna [10]3 years ago
4 0

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\n" % bag_ounces)    

Explanation:

  • Using Python Programming Language
  • The function is defined to accept an int parameter
  • Within the function body, if...elif and else statements are used to print the desired output
  • note the use of the %s placeholder (formated output) and \n for a new line in the final print statement
You might be interested in
Write a statement that outputs variable numObjects. End with a newline.
dalvyx [7]

Answer:

The code is witten in Java and given in the explanation section.

Using a Scanner object we receive a the user's input and with the System.out.println we output the variable

Explanation:

import java.util.Scanner;

public class VariableOutput{

   public static void main (String [] args){

       Scanner input = new Scanner(System.in);

       System.out.println("Enter an Integer 15 or 40");

       int numObjects = input.nextInt();

       System.out.println("You entered the number "+numObjects);

   }

}

7 0
3 years ago
Select all the correct answers.
TEA [102]

Answer:

comlleting novice-level certifications working on one

4 0
3 years ago
A company wishes to increase security at the employee entrance. Which of the following technologies would be the most useful?
AVprozaik [17]
I believe a metal detector would be a fine choice for an employee entrance. 
5 0
3 years ago
Read 2 more answers
Who create and developed castlevania?
Ray Of Light [21]
The game was made by Nintendo. 
Developers: Koji Igarashi<span> </span>Hideo Kojima<span> </span>Michiru Yamane<span> </span><span>Yuzo Koshiro. </span>
6 0
3 years ago
1. What does the term 'in season' mean?
yKpoI14uk [10]
Available at the time of year.
8 0
3 years ago
Read 2 more answers
Other questions:
  • you install teamviewer on your workstation at home so that you can ac ess it when on the road. how can you be assured that unkno
    9·1 answer
  • Which of the following is NOT one of the modules of a typical Decision Support System (DSS)? Select one: a. Customer information
    14·2 answers
  • When security issues are a special concern, companies want to take extra steps to make sure that transmissions can’t be intercep
    7·1 answer
  • Benching system are prohibited in
    5·1 answer
  • A(n) _________ is a computer system which is part of a larger system which performs a dedicated function.
    8·1 answer
  • A technician has been dispatched to a customer site to diagnose an issue where the computer turns off intermittently. Upon arriv
    11·1 answer
  • What is data? why is it important to collect data ? explain the points.​
    10·1 answer
  • Explaio mode of Operation of x-ray​
    15·2 answers
  • Who is the father of computer?​
    14·1 answer
  • What is the difference between
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!