I want to make a program that makes text rainbow using termcolor but I don't know how to make string's into letters
Code:
from termcolor import colored
def rainbow(a):
alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
,'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
a.split(str(alphabet))
print(colored(a, 'red'), colored(a, 'yellow'), colored(a, 'green'), colored(a, 'blue'), colored(a, 'magenta'),
colored(a, 'red'), colored(a, 'yellow'), colored(a, 'green'), colored(a, 'blue'))
rainbow("text")