More of an aside really (as the general issue of how you are using if
inside list comprehensions is well covered in other answers), in this particular case you could do the following:
o = sum(int(x) or 5 for x in s)
This works because or
will use the first value if it is "true" (which in the case of integers means non-zero) or the second value if the first is "false" (here, 0).
The other difference here is that I've used a generator expression instead of a list comprehension -- there is no need to build a list just in order to sum the values.