-1

I'm using vs code, and when i try to run this: print(str(chr(257))) I get this error:ValueError: chr() arg not in range(256)

1 Answers1

2

You seem to be using a Python 2 interpreter to run Python 3 code. As noted in the docs for that function in Python 2.7:

The argument must be in the range [0..255], inclusive; ValueError will be raised if i is outside that range

Switch the interpreter you're using in VS Code to a Python 3 interpreter.

Carcigenicate
  • 43,494
  • 9
  • 68
  • 117