def colour():
c = np.random.uniform(0, 1)
c1 = np.random.uniform(0, 1)
c2 = np.random.uniform(0, 1)
r = hex(int(c*255))[2:]
g = hex(int(c1*255))[2:]
b = hex(int(c2*255))[2:]
return "#" + r + g + b
code = colour()
print(code)
dis = HTML(r'<h3 style="color:{code};">This is the colour you feel like today. Like it? </h3>')
display(dis)
I randomly generate three colors and i want to print my sentence three time with colors generated above.I want to make a list and put three color's string form in it, then use for loop to output my answer.
Hope I explain my question cleary, and if there are any problem, i will give another explanation, thank you!