import random
def create_code(characters):
return list(random.choice(characters)*4)
if __name__ == '__main__':
characters = 'ygobpr'
print create_code(characters)
How to return a list of 4 strings, each random, from the given string characters = 'ygobpr'
?