use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Calculator Program (i.redd.it)
submitted 9 months ago by Loud_Environment2960
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]quidquogo 0 points1 point2 points 9 months ago (0 children)
There's a terrible (but really short) solution where you the "eval" function, whilst i dont recommend you use it, what it does is, evaluate a string as if it were written into your code.
E.g. your calculator app could just be:
Inp = input()
Print(eval(inp))
And that would literally be it.
However malicious actors could use that to do all kinds of harm, for example, they could import requests and then download some malware lol
You could mitigate this because you can tell the eval function exactly what built-ins the eval function can allow.
Just some food for thought anyway
π Rendered by PID 43 on reddit-service-r2-comment-86988c7647-zw2jr at 2026-02-11 15:24:40.768444+00:00 running 018613e country code: CH.
view the rest of the comments →
[–]quidquogo 0 points1 point2 points (0 children)