+ 1

I'm about to make a complex calculator in python

6th Aug 2025, 12:08 PM
Asmaa Abdelsattar
Asmaa Abdelsattar - avatar
11 Antwoorden
+ 3
Asmaa Abdelsattar , do you need any help from the community?
6th Aug 2025, 2:05 PM
Lothar
Lothar - avatar
+ 3
using eval() in python is generally discouraged unless there is no other possible way. eval() executes strings as python code. if any part of the string is user-controlled like inputs, it opens the door to code injection attacks. see comments in this post of stackoverflow: https://stackoverflow.com/questions/1832940/why-is-using-eval-a-bad-practice years ago, we have had discussions about using eval() frequently.
6th Aug 2025, 7:02 PM
Lothar
Lothar - avatar
+ 3
Zvi , it is not a dump question / post, and potential security risks must be taken seriously.
6th Aug 2025, 7:28 PM
Lothar
Lothar - avatar
+ 3
Zvi it's like handing a loaded gun to a kid who don't know any better. I agree, it's a clueless, cryptic question. I also see a lot of similar posts lately and it's depressing. But passing footguns to everyone so they can go shoot themselves is not the way to solve it.... 😅
7th Aug 2025, 5:23 AM
Bob_Li
Bob_Li - avatar
+ 3
Phantom Matryx , any information (including personal information like phone numbers, email addresses) you share in our community is, by design, open to the public and not private. think carefully before sharing any personally identifiable information in any public place.
8th Aug 2025, 11:27 AM
Lothar
Lothar - avatar
+ 2
Rofl!🤣🤣 Can’t wait to see all the security implementations that will be used. Maybe parrot will make a parody of an overengineered calculator complete with salting and encryption!
6th Aug 2025, 10:52 PM
Zvi
Zvi - avatar
+ 1
Just to be sure, as this is a written forum so sometimes these things aren’t obvious, I am saying this all in good humor not flaming or trying be rude. Peace out bro!
6th Aug 2025, 10:54 PM
Zvi
Zvi - avatar
0
Just write print(eval(input())) And your’e done! Thanks parrot for the tip!
6th Aug 2025, 2:35 PM
Zvi
Zvi - avatar
0
Lothar seriously it was a dumb comment on a dumb post. No need to always be so serious.
6th Aug 2025, 7:08 PM
Zvi
Zvi - avatar
0
Bro
7th Aug 2025, 7:24 PM
JO Services HT
JO Services  HT - avatar
0
Just write Calculator = eval(input("enter the equation")) Print(Calculator)
8th Aug 2025, 2:32 AM
Sandy Yaduvanshi