A bug in the python course


#1

bug in python course

Python >10. A Day at the Supermarket>8.Keeping Track of the Produce


though this code is correct,it throws an error.because of a bug.

the bug is ,
when we print value of orange price =1.5 and use %.2f. to print it .. it throws an error

I also mentioned the bug here in forum,
https://www.codecademy.com/courses/python-beginner-en-IZ9Ra/1/3?curriculum_id=4f89dab3d788890003000096

Note:I reported this bug to codecademy support team,they will resolve it soon!

Enjoy!

regards,
Ashutosh Barot


#2

Your output doesn't match the described format, there are a couple of differences.

And also, it expects the default string conversion for floats (%s)


#3

if it expects %s ,then change all the values to integer,(orange=15 in prices)
and then try with %d

it won't give an error ,while using %d ,to print the results

using %2f to print a float value should not be considered as an error..that's the bug