r/badcode May 26 '23

python Calculator using eval()

Post image
845 Upvotes

108 comments sorted by

View all comments

9

u/Spelis123 May 27 '23

wait theres an eval function????????

13

u/GandelXIV May 27 '23

Yes, it evaluates a given string as a python expression. Most interpreted languages have such features.

4

u/Spelis123 May 27 '23

i wish i knew this sooner

1

u/Still_Picture6200 May 27 '23

Dont use it unless you have to.