Created
January 9, 2021 21:31
-
-
Save JayantGoel001/31abd3e578b4c42c6f586445f4f46009 to your computer and use it in GitHub Desktop.
Convert JavaScript Code to python code using js2py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import js2py | |
log = "console.log('Hello World');" | |
pr = js2py.eval_js(log) | |
pr | |
func = '''function add(a,b){ | |
return a+b; | |
}''' | |
a = int(input("Enter a: ")) | |
b = int(input("Enter b: ")) | |
d = js2py.eval_js(func) | |
print(d(a, b)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment