Sep-14-2018, 07:26 PM
(This post was last modified: Sep-14-2018, 07:34 PM by JHPythonLearner.)
Thank you very much for your answer.
I'm assuming that I made 50 photocopies (is this the input you are referring to?)
Regarding lines 7 and 8, here is the logic. Let's say I make 29 copies (more than 10 but less than 30) In this case I would be charged 10 cents for each of the first 10 photocopies and 9 cents for each of the next 19 copies.
How do I fix the total_price variable? How do I define a variable whose value is contingent upon that of another variable (n in this case)?
The input I am using is the code on lines 1, plus the number 50 I entered when "Number of copies" appeared on line 2, plus the code on lines 3 to 11
Regarding lines 9 and 10, here is the logic. Let's say I made 50 copies (as I am assuming). I would be charged 10 cents for each of the first 10 copies, 9 cents for each of copies 11 to 30, and 8 cents for each of copies 31 to 50.
I'm assuming that I made 50 photocopies (is this the input you are referring to?)
Regarding lines 7 and 8, here is the logic. Let's say I make 29 copies (more than 10 but less than 30) In this case I would be charged 10 cents for each of the first 10 photocopies and 9 cents for each of the next 19 copies.
How do I fix the total_price variable? How do I define a variable whose value is contingent upon that of another variable (n in this case)?
The input I am using is the code on lines 1, plus the number 50 I entered when "Number of copies" appeared on line 2, plus the code on lines 3 to 11
Regarding lines 9 and 10, here is the logic. Let's say I made 50 copies (as I am assuming). I would be charged 10 cents for each of the first 10 copies, 9 cents for each of copies 11 to 30, and 8 cents for each of copies 31 to 50.