Jan-07-2024, 11:40 AM
hi
the bellow code:
The above code aims to write in output with different colors. what is the problem?
the bellow code:
''' colorama usage. from net has been taken. ''' from colorama import Fore print(Fore.YELLOW+" hello,world") print(Fore.RED+" hello,world") print(Fore.BLUE+" hello,world") print(Fore.CYAN+" hello,world") print(Fore.GREEN+" hello,world") import time t1=time.monotonic() x=[i for i in range(10_000_000)] t2=time.monotonic() print(f"duration : {t2-t1}")after runing in idle, output is:
Output:[33m hello,world
[31m hello,world
[34m hello,world
[36m hello,world
[32m hello,world
duration : 1.0160000000000764
also in cmd, the output is the above except that there is a left arrow replacing square.The above code aims to write in output with different colors. what is the problem?