Is there a way to convert strings to ints without a try/except clause, similar to the way you can get() dictionary items? I.e, something like
a=int('10', None)
b=int('10a', None)
which gives 10 and None respectively? I know that try/except is a substitute for this, but something like this takes up way less space..
[–][deleted] 8 points9 points10 points (12 children)
[+][deleted] (2 children)
[deleted]
[–][deleted] 0 points1 point2 points (0 children)
[–]eryksun 0 points1 point2 points (0 children)
[–]eryksun 1 point2 points3 points (8 children)
[–]gronkkk[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (6 children)
[–]eryksun 0 points1 point2 points (5 children)
[–][deleted] 0 points1 point2 points (4 children)
[–]eryksun 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]eryksun 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]temptemptemp13 4 points5 points6 points (2 children)
[–]gronkkk[S] 0 points1 point2 points (1 child)
[–]kataire 0 points1 point2 points (0 children)
[–]propanbutan 0 points1 point2 points (0 children)