2
Reply

Select random item using weight

Ask a question
hello,
 
I want to select random items from a list with weight
 
like this
 item - weight
apple   -34
orange-37
strawberry-11
mango-8
banana -3.98
cherry-5.7
grape- 0.3
guava- 0.02
 
please help me with this if i use random generate method this grape and guava which has less than 1 is got as 1 used frequently which i should not want.
 
thanks 

Answers (2)