I use R a lot more and it is easier for me to do it in R:
> test <- c('bbb', 'ccc', 'axx', 'xzz', 'xaa')
> test[grepl("^x",test)]
[1] "xzz" "xaa"
But how to do it in python if test
is a list?
P.S. I am learning python using google's python exercise. And I prefer using regression expression.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…