how can i write javascript code on python 3?

Python doesn’t use constants, so you have to port only the destructuring, which Python also doesn’t have (at least not exactly like ES6).

You can, however, do this:

entities, classification = [obj[k] for k in ("entities", "classification")]

Or, according to this, use the itemgetter.

from operator import itemgetter
entities, classification = itemgetter("entities", "classification")(obj)

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top