mardi 28 novembre 2017

Two random elements from a list Python

I need to write a function named tworandomelements(), that takes a list of elements as input and returns two random elements of the list as a tuple, (n1, n2).The two elements returned should be distinct. Ensure the function returns a suitable value in the case there are fewer than two elements in the input list. Can somebody help me? Any list is ok for me




Aucun commentaire:

Enregistrer un commentaire