Python Forum

Full Version: checking a string for two instances of ..
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i get a string foo that will be a problem if there are two or more instances of the particular characters in another string bar. so if bar has 'apz' then foo must not have more than one 'a' and not more than one 'p' and not more than one 'z'/ i'm looking for a small nifty easy to read way to check foo for this.
What have you tried?
i have not tried anything but planning. this is an anticipated need.