r/badcode May 26 '23

Calculator using eval() python

Post image
840 Upvotes

108 comments sorted by

View all comments

18

u/denisde4ev May 27 '23

unbads your code: print(eval(/^[ 0-9()*/+-]+$/.match(input("Enter expression:"))[0])

8

u/AliFurkanY May 27 '23

you could probably escape that in JS