dimanche 19 décembre 2021

how would I go about getting rid of the square brackets and quote marks when printing a shuffled list [duplicate]

import random

alphabet = ["R","G","B","Y"]
random.shuffle(alphabet)

code = alphabet[0:3]

this is my code and when I print "code" It returns something like this ['B','G','R']. I want to make it so that it only displays BGR for example.




Aucun commentaire:

Enregistrer un commentaire