Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def is_engg_string(string):
- if len(string) >= 4:
- if string[0] in 'eE' and string[1] == 'N':
- temp_str = string[1:]
- while len(temp_str) > 0:
- if temp_str[0] == 'N':
- temp_str = temp_str[1:]
- else:
- break
- if temp_str == 'GG':
- return True
- else:
- return is_engg_string(temp_str)
- else:
- return False
- else:
- return False
- n = int(input())
- cases = [input() for _ in range(n)]
- solved_cases = [is_engg_string(case) for case in cases]
- is_lowercase = True
- if is_lowercase:
- [print(str(case).lower()) for case in solved_cases]
- else:
- [print(case) for case in solved_cases]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement