pythonprintingtermcolor

Combining python print statements


Is it possible to combine the the following two statements into one?

print(colored(score,"green"),end=" ")
print(colored(tokens,"green"))

Solution

  • Yes, simply add the last item to the first print statement:

    print(colored(score,"green"), colored(tokens,"green"))