def color_it(*tags, text): tag_list = dict(resetall='\033[0m', bold='\033[1m', dim='\033[2m', underline='\033[4m', blink='\033[5m', reverse='\033[7m', hidden='\033[8m', white='\033[30m', red='\033[31m', green='\033[32m', yellow='\033[33m', blue='\033[34m', magenta='\033[35m', cyan='\033[36m', lightgray='\033[37m', darkgray='\033[90m', lightred='\033[91m', lightgreen='\033[92m', lightyellow='\033[93m', lightblue='\033[94m', lightmagenta='\033[95m', lightcyan='\033[96m', black='\033[97m', bgwhite='\033[40m', bgred='\033[41m', bggreen='\033[42m', bgyellow='\033[43m', bgblue='\033[44m', bgmagenta='\033[45m', bgcyan='\033[46m', bglightgray='\033[47m', bgdarkgray='\033[100m', bglightred='\033[101m', bglightgreen='\033[102m', bglightyellow='\033[103m', bglightblue='\033[104m', bglightmagenta='\033[105m', bglightcyan='\033[106m', bgblack='\033[107m') tags_for_text = '' for tag in tags: tag = tag.lower() if tag in tag_list: tags_for_text += tag_list[tag] # adding tags, adding text, clearing tags text = tags_for_text + text + tag_list['resetall'] return text print(color_it("Bold", "Black", "bgYellow", text="Hello, World!"))