mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-03-03 21:38:40 +00:00
safe eval used
This commit is contained in:
parent
aa66c4b48c
commit
d44d0a810f
@ -135,14 +135,15 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
testmod()
|
testmod()
|
||||||
|
|
||||||
# func, a, b = get_inputs()
|
func_str, a, b = get_inputs()
|
||||||
# acc = 1
|
acc = 1
|
||||||
# solution = None
|
solution = None
|
||||||
|
|
||||||
# while acc <= 100_000:
|
func = safe_function_eval(func_str)
|
||||||
# table, h = compute_table(func, a, b, acc)
|
while acc <= 100_000:
|
||||||
# add = apply_weights(table)
|
table, h = compute_table(func, a, b, acc)
|
||||||
# solution = compute_solution(add, table, h)
|
add = apply_weights(table)
|
||||||
# acc *= 10
|
solution = compute_solution(add, table, h)
|
||||||
|
acc *= 10
|
||||||
|
|
||||||
# print(f'Solution: {solution}')
|
print(f'Solution: {solution}')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user