blob: 8bf220971be22f65d1efe1be9bfd1a2ed0af6d40 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#!/usr/bin/env python3
import re
import sys
import re
def b_after_a(s: str) -> bool:
"""
Checks if the string 's' contains the letter 'a' does not appear after a 'b'.
Args:
s (str): The input string to be checked.
Returns:
bool: True if the criteria is met, False otherwise.
"""
return re.search(r'^[^b]*b[^a]*$', s) is not None
def main():
result = b_after_a(sys.argv[1])
print(result)
if __name__ == '__main__':
main()
|