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
serious [3.7K]
3 years ago
9

Write a function shampoo_instructions() with parameter num_cycles. If num_cycles is less than 1, print "Too few.". If more than

4, print "Too many.". Else, print "N : Lather and rinse." num_cycles times, where N is the cycle number, followed by "Done.". Sample output with input: 2 1 : Lather and rinse. 2 : Lather and rinse. Done. Hint: Define and use a loop variable.
Computers and Technology
1 answer:
Masteriza [31]3 years ago
7 0

Answer:

See explaination

Explanation:

#Run the code in the python version 3.x.

#Define the function.

def shampoo_instructions(num_cycles):

#Check the cycles to be greater than 1.

if num_cycles < 1:

#Display the statement.

print('Too few.')

#Check the cycles to be greater than 4.

elif num_cycles > 4:

#Display the statement.

print('Too many.')

#The else part.

else:

#Initialize the variable.

N = 1;

#Begin the for loop.

for N in range(N, num_cycles+1):

#Print the result.

print(N , ": Lather and rinse.")

#Print the statement.

print('Done.')

#Call the function.

shampoo_instructions(2)

You might be interested in
Scripting languages are unique computer languages with a specialized function. explain what scripting languages do, and how this
yarga [219]

Scripting languages are unique computer languages because they automate task that could be done by human operator and are easy to use.

<h3>What is a scripting language?</h3>

Scripting languages are programming languages that is interpreted.

They are programming languages that automates the task that will originally be performed by a human operator.

Scripting languages are used to give instruction to other software to run accordingly to how you want it.

The scripting language is different form other language base on the fact that its interpreted . This means the code are translated to machine code when it is run.

The major advantage of scripting languages is that it is human readable and understandable.

Examples of scripting languages are Python and JavaScript.

learn more on scripting here: brainly.com/question/12763341

#SPJ1

3 0
2 years ago
What is the best Describe an integer data type
kolbaska11 [484]

Answer:

It is a data type that only holds whole numbers, a.k.a. integers.

what is the picture about?

3 0
2 years ago
How to learn python ?
laila [671]

Answer:

https://www.python.org/about/gettingstarted/

Explanation:

its a site i used

7 0
3 years ago
You currently have 15 switches with an average of 20 stations connected to each switch. The switches are connected to one anothe
vampirchik [111]

Answer:

Reorganize the network into smaller groups and connect each group to a router.

Explanation:

The user presently has 15 switches linked to another switch, with such an avg of 20 locations. The switches are linked to each other in such a manner that almost all systems can convey within a single Local area network. The high percentage to broadcast frames were found on that Local area network. They believe the amount of broadcasts could affect throughput.

So, they would reorganize each network into smaller units and link to such a router for each unit.

4 0
3 years ago
Each TextField has a text property that's returned by its textProperty method as a StringProperty. The StringProperty method ___
masha68 [24]

Answer:

B: Bind

Explanation:

JavaFX property binding permits the synchronization of the value of two properties in such a way that whenever there is a change in one of the properties, there is an immediate update on the value of the other property. In this way, The StringProperty method bind receives an ObservableValue as an argument. When the ObservableValue changes, the bound property is updated accordingly.

4 0
3 years ago
Other questions:
  • Which setting indents all but the first line of a paragraph by the selected length?
    6·1 answer
  • How many seconds are required to make a left turn and join traffic?​
    11·2 answers
  • Write a program that prints the day number of the year, given the date in the form month-day-year. For example, if the input is
    9·1 answer
  • Assume you're using a three button mouse. To connect shortcut menus, you would what
    6·1 answer
  • After selecting multiple calendars, how do you view them in one single calendar? Open the Backstage view and then the Calendar o
    6·2 answers
  • Which type of infrastructure service stores and manages corporate data and provides capabilities for analyzing the data
    12·1 answer
  • Raw materials have two basic types what are the 2?
    11·2 answers
  • Can i eat chicken and you shut
    14·2 answers
  • A bulb has a resistance of 15Ω and is rated at 3A. What is the maximum voltage that can be applied across the bulb?
    7·1 answer
  • Write pseudo code that performs the following: Ask a user to enter a number. If the
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!