Иван Сеченых, 521 (асвк+мк+мс) CopyPaste 1669 | Вяткина Анна, 619/2 группа CopyPaste 2669 | ||||
---|---|---|---|---|---|
f | 1 | import ast | f | 1 | import ast |
2 | 2 | ||||
t | 3 | def copypaste(one, two): | t | 3 | def copypaste(f1, f2): |
4 | treeA = ast.parse(one) | 4 | ast1 = ast.parse(f1) | ||
5 | treeB = ast.parse(two) | 5 | ast2 = ast.parse(f2) | ||
6 | for A, B in zip(ast.walk(treeA), ast.walk(treeB)): | 6 | for node1, node2 in zip(ast.walk(ast1), ast.walk(ast2)): | ||
7 | if type(A) != type(B): | 7 | if type(node1) != type(node2): | ||
8 | break | 8 | return False | ||
9 | else: | ||||
10 | return True | 9 | return True | ||
11 | return False |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|