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.
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.
Chapter8: Working With Advanced Functions
Section: Chapter Questions
Problem 4.4CP
Related questions
Question
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.
![< >
learn.zybooks.com
b Search results for 'Write a function sham...
ży Section 5.7 - IT 140: Introduction to Scri...
B 5-3 Project One Submission - IT-140-J6...
B Project One Guidelines and Rubric - IT-1...
My Courses
= zyBooks My library > IT 140: Introduction to Scripting v3 home > 5.7: Functions with branches/loops
E zyBooks catalog
? Help/FAQ
8 Victoria Thibodeaux
CHALLENGE
5.7.2: Function with loop: Shampoo.
АCTIVITY
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.
247772.1992070.qx3zqy7
1 def print_popcorn_time(bag_ounces):
if bag_ounces < 3:
print("Too small")
if bag_ounces > 10:
print("Too large")
2
1 test
passed
3
4
5
All tests
6.
else:
passed
7
print(str(6 * bag_ounces)+
seconds")
8
9 user_cycles
10 shampoo_instructions(user_cycles)
int(input())
Run
X Test aborted](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F0fb6fbe8-c93b-4e2e-8100-eedf21471e21%2Fbec745a1-5996-4a8f-abe3-b44eb51224d5%2Fpl4tm7v_processed.png&w=3840&q=75)
Transcribed Image Text:< >
learn.zybooks.com
b Search results for 'Write a function sham...
ży Section 5.7 - IT 140: Introduction to Scri...
B 5-3 Project One Submission - IT-140-J6...
B Project One Guidelines and Rubric - IT-1...
My Courses
= zyBooks My library > IT 140: Introduction to Scripting v3 home > 5.7: Functions with branches/loops
E zyBooks catalog
? Help/FAQ
8 Victoria Thibodeaux
CHALLENGE
5.7.2: Function with loop: Shampoo.
АCTIVITY
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.
247772.1992070.qx3zqy7
1 def print_popcorn_time(bag_ounces):
if bag_ounces < 3:
print("Too small")
if bag_ounces > 10:
print("Too large")
2
1 test
passed
3
4
5
All tests
6.
else:
passed
7
print(str(6 * bag_ounces)+
seconds")
8
9 user_cycles
10 shampoo_instructions(user_cycles)
int(input())
Run
X Test aborted
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![Systems Architecture](https://www.bartleby.com/isbn_cover_images/9781305080195/9781305080195_smallCoverImage.gif)
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![Systems Architecture](https://www.bartleby.com/isbn_cover_images/9781305080195/9781305080195_smallCoverImage.gif)
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning