We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
**The input is a python code to print the result of the expression.
Pass it to the eval() method it will convert it into a code and print it.
So, the answer is eval(var) where the sample var is equal to print(2+3). The eval is so powerful that it took the print word as keyword not the string.
CODE:
eval(var)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Python Evaluation
You are viewing a single comment's thread. Return to all comments →
**The input is a python code to print the result of the expression. Pass it to the eval() method it will convert it into a code and print it. So, the answer is eval(var) where the sample var is equal to print(2+3). The eval is so powerful that it took the print word as keyword not the string. CODE: eval(var)