Skip to content

Instantly share code, notes, and snippets.

@savolla
Created March 5, 2017 14:57
Show Gist options
  • Save savolla/a545b356d5e14deb2620cda16ef93072 to your computer and use it in GitHub Desktop.
Save savolla/a545b356d5e14deb2620cda16ef93072 to your computer and use it in GitHub Desktop.
in this gist, I wanted to make some serious things. there is a function called eval() in python. With this function we can enter actual and working python commands in input() function which is going to be executed after pressing enter. so okay as you know there are bunch of hackers! and they might crack our very important program with this eval(…
cluster = "0123456789-+/*"
operation = input("please do your math operation\n: ")
for i in operation:
if i not in cluster:
print("please work with numbers mr. hacker!")
break
else:
break
print(eval(operation))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment