Reputation: 25
for_sample <- c("The variance is driven by ",
"The majority of the variance is due to ",
"Driven by ",
"The key movements were driven by ")
sampled<- sample(for_sample, 2)
I am able to understand that the output will be different every time. I just want to replicate the same operation using python.
Upvotes: 0
Views: 28
Reputation: 1382
Do this:
import random
for_sample = ["The variance is driven by ",
"The majority of the variance is due to ",
"Driven by ",
"The key movements were driven by "]
sampled = random.sample(for_sample, 2)
Upvotes: 1