Count Substring In String Python Without Library Function For Power