Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def is_same_char(src_str, character):
- for c1 in src_str:
- if character != c1:
- return False;
- return True
- def inc_length(src_str, character):
- src_strs = src_str.split()
- count = 0
- for src_str in src_strs:
- if not is_same_char(src_str, character) or count >= len(src_str):
- return False
- else:
- count = len(src_str)
- return True
- print inc_length("a aa aaaaa", 'a')
- print inc_length("b bbbbb bb", 'b')
- print inc_length("b bb bbb", 'a')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement