14 lines
419 B
Python
Executable file
14 lines
419 B
Python
Executable file
#!/usr/bin/python3
|
|
# py calc
|
|
alphanumeric = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
|
|
while True:
|
|
payload = input("I'll crunch your number, not letters!\n")
|
|
if (any(c in alphanumeric for c in payload)):
|
|
print("NO!")
|
|
continue
|
|
try:
|
|
print(eval(payload, {'__builtins__': {}}, {}))
|
|
except Exception as e:
|
|
print("something went wrong")
|
|
print(e.__class__)
|