[ create a new paste ] login | about

Link: http://codepad.org/vNEv6B8M    [ raw code | output | fork ]

Python, pasted on Oct 9:
1
2
3
4
import re
x = [ [1, 2], 1, 1, [2, 1, [1, 2]] ]
nums = [int(i) for i in re.findall(r'\d+', str(x))]
print(nums.count(1))


Output:
1
5


Create a new paste based on this one


Comments: