I have a list with integers. I want to choose 80% from them.
For example, for [1,...,30] I want to keep 80% from the list with random so I get for example [1,...,32]\[3,7,19,21,25,29] (It means it deleted 3,7,19,21,25,29 values from the original list. How can I do it?
import random
random.sample(lst, k=round(len(lst) * 0.8))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With