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
What is the memory of a computer called
Nataliya [291]
It is called Ram in another term for memory :)
6 0
3 years ago
Read 2 more answers
Why do some people argue that tech companies like Apple should do more to address the smartphone addiction problem?
Neko [114]

Answer:

Cause It Will Help Make A Fix For The Issue

Explanation:

Does This Help?

5 0
3 years ago
If a= ‘ Stay home, Stay safe’ , print its value
Damm [24]

Answer:

Since the language isn’t stated, I’ll give answers in the two most-used (?) languages: Java and Python.

a) To print a’s value 3 times in the same line, in Java we would do:

System.out.print(a+a+a);

In Python, we would write:

print(a*3)

b) 2 times in different lines using one print statement

In Java, we would write

System.out.println(a+”\n”+a+”\n”+a);

In Python we would write:

print(a,a,a,sep=’/n’)

Hope this helps!

7 0
2 years ago
What is communication barriers?​
SSSSS [86.1K]

Answer:

A communication barrier is anything that prevents us from receiving and understanding the messages others use to convey their information, ideas and thoughts.They can interfere with or block the message you are trying to send.

7 0
3 years ago
Read 2 more answers
You have been tasked with designing an Ethernet network. Your client needs to implement a very high-speed network backbone betwe
lorasvet [3.4K]

Answer:

A and C

Explanation:

From the above scenario, the Ethernet standards that meet the above guidelines are:

A. 1000BaseSX; and

C. 10GBaseSR.

Cheers

3 0
3 years ago
Other questions:
  • If reading or writing a cache line of size 64 bytes to Flash requires 2.56 μJ and DRAM requires 0.5 nJ, and if idle power consum
    9·1 answer
  • Emotional intelligence is a new term to describe personal traits ?
    12·1 answer
  • laire writes a letter to her grandmother, in which she describes an amusement park she visited last week. She adds pictures of t
    11·1 answer
  • What is not an option when a user is exporting contacts to share with others?
    10·1 answer
  • Which of the following statement is correct? Select one: a. Base register holds the size of a process. b. Limit register holds t
    10·1 answer
  • Write a program. Commence the change to be dispensed from a vending machine. An item machine can cost between $0.25 send a dolla
    9·1 answer
  • Write a flowchart and C code for a program that does the following: Uses a do...while loop. Prints the numbers from 1 to 10 with
    13·1 answer
  • Design an Application called Student Course Management create interface called Student Course add an abstract method called ad C
    10·1 answer
  • Which of the following is the most significant result of technological innovation?
    10·2 answers
  • ANs and WANs can be set up in several different shapes, also known as peripherals.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!