JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Gallery
Solution Debug 6.1. Loop Control
Share
Explore
Gallery
Solution Debug 6.1. Loop Control
Solution Debug 6.1. Loop Control
Solution
The Task
Python Starter Code
CodeClips
Solution
Solution
solution
print
(
'\n'
)
# display blank line
# enter product
product
=
input
(
'Enter product for this batch: '
)
# enter scent
fragrance
=
input
(
'Enter fragrance for this batch: '
)
# enter scent
batchCode
=
int
(
input
(
'Enter batch code number: '
)
)
# enter scent
batchSize
=
int
(
input
(
'Enter number of products in this batch: '
)
)
print
(
'\n\n'
)
# display blank line (2)
# prints out a label for every product box
for
i
in
range
(
batchSize
)
:
print
(
'Scents of Scotland 🏴'
)
print
(
'Enjoy our hand-crafted '
+
product
)
print
(
'Fill your home with the beautiful scent of '
+
fragrance
)
print
(
'Quality Control: Batch#'
+
str
(
batchCode
)
+
' - Serial#'
+
str
(
i
+
1
)
)
print
(
'...........................................................\n'
)
original
print
(
'\n'
)
# display blank line
# enter product
product
=
input
(
'Enter product for this batch: '
)
# enter scent
fragrance
=
input
(
'Enter fragrance for this batch: '
)
# enter scent
batchCode
=
int
(
input
(
'Enter batch code number: '
)
)
# enter scent
batchSize
=
int
(
input
(
'Enter number of products in this batch: '
)
)
print
(
'\n\n'
)
# display blank line (2)
# prints out a label for every product box
for
i
in
range
batchSize
:
print
(
'Scents of Scotland 🏴'
)
print
(
'Enjoy our hand-crafted '
+
product
)
print
(
'Fill your home with the beautiful scent of '
+
fragrance
)
print
(
'Quality Control: Batch#'
+
str
(
i
)
+
' - Serial#'
+
str
(
batchSize
)
)
print
(
'...........................................................\n'
)
Gallery
Share
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
Ctrl
P
) instead.