fork download
  1. lst=[[[1,2,3]],[[4,5,6]]]
  2. def are_addable(lst):
  3. if(len(lst[0])==len(lst[1]) and len(lst[0][0])==len(lst[1][0]) and is_wellformed(lst[0])=='True' and is_wellformed(lst[1])=='True'):
  4. return("True")
  5. else:
  6. return("False")
  7. def add_lists(lst):
  8. l=[0 for i in range(len(lst[0]))]
  9. for i in range(len(lst[0])):
  10. l[i]=lst[0][i]+lst[1][i]
  11. return(l)
  12. def add_matrices(lst):
  13. m=[ [ 0 for i in range(len(lst[0][0])) ] for j in range(len(lst[0])) ]
  14. if(are_addable(lst)=='True'):
  15. for i in range(len(lst[0])):
  16. m[i]=add_lists(lst[0][i],lst[1][i])
  17. return(m)
  18. else:
  19. return("Invalid input")
  20. print(add_matrices(lst))
Compilation error #stdin compilation error #stdout 0.02s 9140KB
stdin
Standard input is empty
compilation info
Traceback (most recent call last):
  File "/usr/lib/python3.7/py_compile.py", line 143, in compile
    _optimize=optimize)
  File "<frozen importlib._bootstrap_external>", line 791, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "./prog.py", line 17
    return(m)
            ^
IndentationError: unindent does not match any outer indentation level

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.7/py_compile.py", line 147, in compile
    raise py_exc
py_compile.PyCompileError: Sorry: IndentationError: unindent does not match any outer indentation level (prog.py, line 17)
stdout
Standard output is empty