updated calculartor

This commit is contained in:
Saifeddine ALOUI 2024-05-22 21:01:46 +02:00
parent b3291c5878
commit d25a23f93c

View File

@ -1,7 +1,7 @@
import math
from functools import partial
def calculate(expression: str) -> float:
def calculate(expression: str) -> float:
try:
# Add the math module functions to the local namespace
allowed_names = {k: v for k, v in math.__dict__.items() if not k.startswith("__")}