Change print item to:
print item,in Python 2.7print(item, end=" ")in Python 3
If you want to print the data dynamically use following syntax:
print(item, sep=' ', end='', flush=True)in Python 3
Change print item to:
print item, in Python 2.7print(item, end=" ") in Python 3If you want to print the data dynamically use following syntax:
print(item, sep=' ', end='', flush=True) in Python 3