fork download
  1. def bar(x: str, y: int):
  2. print(x[:y])
  3.  
  4. def foo(x, y):
  5. bar(x, y)
  6.  
  7. def main():
  8. foo('abcde', '2')
  9.  
  10. if __name__ == "__main__":
  11. main()
  12.  
Runtime error #stdin #stdout #stderr 0.04s 9316KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 11, in <module>
  File "./prog.py", line 8, in main
  File "./prog.py", line 5, in foo
  File "./prog.py", line 2, in bar
TypeError: slice indices must be integers or None or have an __index__ method