Python Dictionary Length Function For String