I know that in python, you can't simply do this:
number = 1
print "hello number " + number
you have to do this:
print "hello number " + str(number)
otherwise you'll get an error.
My question is then, being python such a compact language and this feature of automatic casting/converting from integer to string available in so many other languages, isn't there away to avoid having to use the str()
function everytime? Some obscure import, or simply another way to do it?
Edit: When I say another way, I mean simpler more compact way to write it. So, I wouldn't really consider format
and alternative for instance.
Thanks.