Here is the exercise -
In the code editor, we’ve already initialized the variable a_price
with a value of 0
. Transcribe the following sentences into code by making use of if
statements:
- If
a_price
is equal to0
, then print the string'This is free'
(remember to use the==
operator for equality). - If
a_price
is equal to1
, then print the string'This is not free'
.
My result -
1 a_price = 0
2 if a_price == 0:
3 print('This is Free')
4 if a_price == 1:
5 print('This is not Free')
So when I submit the answer - I get this message
The output of your code didn’t match what we expected.
So I checked for the answer and it shows that my answer is correct.
So I don’t understand why it displayed that message - The output of your code didn’t match what we expected.