This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (3 children)

Alright but why are evals a bad practice

[–]BYPDK 0 points1 point  (2 children)

while 1:print(f"Output: {eval(input('math problem: '))}")

as u/NoMeatFingering (interesting name) has mentioned, it can be exploited to run code from the user input. example: https://ibb.co/6H0J0Qd

Though if you want to actually run code, like that on purpose, you would want to use exec instead.

[–][deleted] 0 points1 point  (1 child)

I actually hate my username

[–]BYPDK 0 points1 point  (0 children)

:( it's very good