A brief example:
zero = 0
print('exemplo',zero)
The program shows:
example 0
I wanted without the space:
example0
A brief example:
zero = 0
print('exemplo',zero)
The program shows:
example 0
I wanted without the space:
example0
In this exact way, print('exemplo',zero)
, no.
But the way (available only in python3.x) more like this, in which the space is removed is:
zero = 0
print('exemplo', zero, sep='') # exemplo0
Here are other ways to do this:
zero = 0
print('exemplo{}'.format(zero))
+
sign
print('exemplo' +str(zero)) # aqui, se ja for string escusas de usar str(...)
print('exemplo%d' % zero)
You can also create your own print()
for things like this:
def my_print(*args):
print(*args, sep='')
zero = 0
my_print('example', zero, 1, 2, 'olá') # example012olá