3 ms·
Note that a number of these seem to be from people including Python itself within their project [0]. (Arguably, this could also be considered a mistake.) Python
by alecdbrooks 12y ago
Note that a number of these seem to be from people including Python itself within their project [0]. (Arguably, this could also be considered a mistake.) Python 2 defines the input() built-in, which is documented as:
>input([prompt]) -> value
>Equivalent to eval(raw_input(prompt)).
Github is turning up these results because that bit of Python is inside the C code as a string documenting the function.
Python 3 does not evaluate what's passed to input(), however. To get the same effect, use eval(input()). [1]
[0]: Limiting it to C examples https://github.com/search?l=c&q=%22eval%28raw_input%28%29%29%22&ref=searchresults&type=Code https://github.com/search?l=c&q=%22eval%28raw_input%28%29%29...
[1]: https://docs.python.org/3.0/whatsnew/3.0.html#builtins https://docs.python.org/3.0/whatsnew/3.0.html#builtins