I want to create string using integer appended to it, in a for loop. Like this:
for i in range(1,11):
string="string"+i
But it returns an error:
TypeError: unsupported operand type(s) for +: 'int' and 'str'
What's the best …
Is there any way to tell whether a string represents an integer (e.g., '3', '-17' but not '3.14' or 'asfasfas') Without using a try/except mechanism?
is_int('3.14') = False
is_int('-7') = True