jeudi 11 mars 2021

How can I print a random element from a list of strings in Racket?

I have a list of words (define list-of-elements'(apple, carrot, tomato, cucumber)) I have tried using (random) in order to print a random element from the list, but from what I have seen in the errors (random) is used for integers. How could I print a random element from the list?




Aucun commentaire:

Enregistrer un commentaire