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
Nesterboy [21]
3 years ago
7

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.

Computers and Technology
1 answer:
Rashid [163]3 years ago
3 0

Answer:

The code written in python and fully commented for this question is given below:

# Create the function shampoo_instructions with the num_cycles parameter input

def shampoo_instructions(num_cycles):

   # Condition if is less than 1, print too few

   if num_cycles < 1:

       print("Too few.")

   # Condition if is greater than 4, print too many

   elif num_cycles > 4:

       print("Too many.")

   # If is in inclusive range [1,4], print the Lather and rinse cycle

   else:

       # Create a for loop to print rinse cycle

       for i in range(num_cycles):

           print("{}: Lather and rinse.".format(i+1))

   # Print an end string for each execution

   print("End-------------------------------------")

# Call the function with all the conditions tested

shampoo_instructions(3)

shampoo_instructions(0)

shampoo_instructions(4)

shampoo_instructions(5)

Explanation:

I attach an image that contains the output of the execution and the source code.

You might be interested in
PLS HELP I GOT 30 MINS TO TURN THIS IN!!!
tekilochka [14]

Answer:

it is actually a phone video gaming tv and stuff that you play with like cars and other stuff

Explanation:

4 0
2 years ago
Read 2 more answers
How to use a state value in stylesheet in react native.
lana66690 [7]

Answer:

Change this code:

return <View style={[styles.container, backgroundColor: this.state.bg]}/>

for this code:

return <View style={[styles.container, {backgroundColor: this.state.bg}]}/>

3 0
2 years ago
Pls help asap<br> 40 pts<br><br> How to determine the audience for a storyboard for a movie review?
Alecsey [184]
Look at the subject of the movie, think about the type of people that would watch that, gore/blood- boy teens sad/depressing- girl teens
8 0
2 years ago
The valence electron configurations of several atoms are shown. how many bonds can each atom make without hybridization? 2s^2 2p
Pie
Answer: This element needs 3 electrons to complete its octet state

Why?:
since the electrons in 2s2 are already paired they cannot form a bond pair with electrons from other elements without hybridisation however the 3 electrons in 2p3 are unpaired so can form bond pairs with electrons from other elements without hybridisation.

Hope this helps!
3 0
3 years ago
A database is used instead of a spreadsheet when ________.
Ierofanga [76]

Answer:

C. Lists involve data with multiple themes

Explanation:

<em>First of all, it will be beneficial to explain all the concepts involved.</em>

<em />

A spreadsheet is an electronic ledger in which data is arranged in rows and columns of a grid and can be manipulated and used in calculations.

A database can be defined as a structured set of data held in a computer, especially one that is accessible in various ways.

A theme in data storage refers to the subject matter or topic  that categorizes various data sets.

A spreadsheet can be used to store and analyse simple data sets as shown in the options A, B and D. However for option C, a database must be used if it needs to be done accurately.

A data base is more robust than a spreadsheet and can accommodate a lot more diversities in the data sets.

Spreadsheets are built to simplify data analysis, and have their candid limitations - they cannot assure data integrity or consistency when dealing with data of various subject matters.

Lists that involve data with multiple themes can be easily handled with data bases, because data bases specialize in collecting raw data in a tabular form which cannot be formatted. This helps sort out the data into their various themes.

The tables on a database can be programmed to accept a particular theme of data, and nothing else. however, this cannot be done with spreadsheets, as the cells accept the data first before it is formatted to the data type it is. Thus databases help ensure consistency and integrity of the data when dealing with data of multiple themes

5 0
3 years ago
Other questions:
  • How have search engines like Google, Bing, and Yahoo! revolutionized the ability to do research? They are more difficult to acce
    15·2 answers
  • P**nhub or x-videos or other
    9·1 answer
  • The variety of theatre introduced in the 1960s that denotes semi-professional or even amateur theatre in the New York/Manhattan
    11·1 answer
  • To insert a column without using commands in any tabs, a user can _____ -click and then click insert column.
    6·2 answers
  • What year did buck tooth bob become famous
    11·2 answers
  • What are invoices? A. Documents that convey a company's liabilities B. Documents that convey how much a company was earning and
    5·2 answers
  • Defensive programming is sometimes referred to as _________.
    5·1 answer
  • What is all about programming interactions in the real world.
    6·1 answer
  • Where are 'if' and 'else' statements shown when printing a document in a word processor?
    8·1 answer
  • What types of things were often NOT captured in early photographs?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!