Why is this course teaching a broken java-style concatenation when printing


On exercise 13, the solution it wants is:

print "The value of pi is around " + str(3.14)

But this what java developers first transitioning to python write. Instead we should have:

print "The value of pi is around", 3.14

and let the print statement take care of the space and the str conversion for us. This is dumb. What's even worse is that using the print statement as I suggest shows the correct output in the console, but doesn't pass the test.


because the exercise validates that you use str() to do the conversion. We can't allow all creative solution, then the amount of code to validate becomes to huge.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.