n | | n | import sys |
| import ast | | import ast |
n | import sys | n | |
| | | |
n | def ifif(program): | n | def check_valid_python_code(text): |
| try: | | try: |
n | code = ast.parse(program) | n | parsed = ast.parse(text) |
| for n in ast.walk(code): | | for node in ast.walk(parsed): |
| if isinstance(n, ast.If): | | if isinstance(node, ast.If): |
| return True | | return True |
| return False | | return False |
| except SyntaxError: | | except SyntaxError: |
| return False | | return False |
t | program = sys.stdin.read() | t | input_text = sys.stdin.read() |
| print(ifif(program)) | | print(check_valid_python_code(input_text)) |