I need a command in python which filters the letters in a string but not deleting them for example:
string =raw_input("Enter the string:")
if string.startswith("a") and string.endswith("aaa"):
print "String accepted"
else: print "String not accepted"
if "ba" in string:
print "String accepted"
else :
print "String is not accepted"
What should I add to ban other letters except a and b in the string