You should get an error on the
string_count(x)
line saying that x is not defined because x is inside the function in the code you posted and therefore local to the function only. There is no error "'int' object not iterable" and you have not posted the complete error message so we have no way of knowing what the problem is.
Comment