I don't know the reasoning why Python would allow this, but I'm not familiar with much of the philosophy of Python. In JavaScript this "doesn't work" simply because performing math on text makes no sense.
@David please, let's not start discuss JavaScript and "makes sense" :) Anyway, you can't argue that string * 4 does not work in JS because "performing math on text makes no sense" while JS allows string + 4 (which Python does not allow, BTW). It just that * is not defined in JS for string and integer operands, not that "it makes no sense"
string * 4does not work in JS because "performing math on text makes no sense" while JS allowsstring + 4(which Python does not allow, BTW). It just that*is not defined in JS for string and integer operands, not that "it makes no sense"