Created
March 5, 2017 14:57
-
-
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(…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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