【发布时间】:2015-03-10 05:18:07
【问题描述】:
如何在@之后和之前找到数字(帖子编号);;因为字符串中还有其他数字。最后,它产生了 [507, 19, 1]。
例子:
post507 = "@507::empty in Q1/Q2::can list be empty::yes"
post19 = "@19::Allowable functions::empty?, first, rest::"
post1 = "@1::CS116 W2015::Welcome to first post::Thanks!"
cs116 = [post507, post1, post19]
print (search_piazza(cs116, "l")) =>[507,1,19]
【问题讨论】:
-
您的预期结果是什么?你有没有尝试过?