dimanche 29 mars 2020

How can I generate a random item from this element by calling the function?

I'm trying to get a random item from this list by calling the function that I made for it.
Nothing is working.

import random
def ColorText(colorText):
    colorText = ['Red', 'Blue', 'Green', 'Yellow', 'Black', 'Brown', 'Purple',
                 'Gray', 'Orange']

print(ColorText(random.choice(colorText)))



Aucun commentaire:

Enregistrer un commentaire