We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 906a424 commit c4f9a77Copy full SHA for c4f9a77
evaluate_math_string.py
@@ -1,13 +1,5 @@
1
-# -*- coding: utf-8 -*-
2
-"""Evaluate Math String.ipynb
3
-
4
-Automatically generated by Colab.
5
6
-Original file is located at
7
- https://colab.research.google.com/drive/1MKL7Spf2NpQzo_aspdM2XM0rv9B6eBHZ
8
-"""
9
10
# Following Code will evaluate the math equation written in a string
+
11
def evaluate(expression):
12
for equation in expression:
13
if len(equation)>1 and len(equation)<=100:
@@ -21,4 +13,4 @@ def evaluate(expression):
21
result = eval(equation)
22
14
print(float(result))
23
15
24
-evaluate(["5 plus ( 3 times 2 )", "2 plus ( 5 times 6 )"])
16
+evaluate(["5 plus ( 3 times 2 )", "2 plus ( 5 times 6 )"])
0 commit comments