How to Format Text in Python
Hello all .. Please someone tell me atleast 5 ways to format text in Python. Thanks 😊
If this is a homework question, please do not ask us, if it isn’t, I’m sorry for thinking it is.
There are not many ways to format text in python like you can do in html.... But in python(with turtle) you can style text that you draw. In regular python you can make your text bold, underlined, different colors, and more!
Cool Way to print out text here!
from colorama import Style print(Style.BRIGHT+"This is Bold") #Can also be dim/opposite of bold print(Style.DIM+"This is Dim") #Reset the style print(Style.RESET_ALL+"This is normal")
print("\u0332".join("Underlined text goes here")
from colorama import Fore print(Fore.RED+"Red text") print(Fore.BLUE+"Blue text") Can be any of these colors: Fore: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET. #Reset changes back to white
Here check this out:
Happy coding and hope this helps! =)