I built a basic script that shows a string of random binary values (0 and 1) i times through a for loop.
It doesn't bother me, but in every loop, it automatically creates a new line and then prints the binary value
Example of the output:
1
0
1
1
0
...
Why is that? And how can I display the values in a "newlineless" string (without spaces too)?
Like 001010001011010111010, as an example.
Here's the code:
i = 20 #number of random binary to be shown
for x in range(i):
bin = randint(0, 1)
print(bin)