Mar-17-2018, 04:05 PM
The output I get after running your code is:
Output:[ mystring ]
It is because print function's default separator is a whitespace. If you want to change the separator, you can specify it explicitly:print("[",a,"]", sep='')An alternative you can use, which is also more generic, is to format the string (with format method):
print("[{}]".format(a))