Skip to content

Instantly share code, notes, and snippets.

@code2be
Created September 11, 2022 15:28
Show Gist options
  • Save code2be/22e2f575b5e4851a3e3c3c6a2493f5fe to your computer and use it in GitHub Desktop.
Save code2be/22e2f575b5e4851a3e3c3c6a2493f5fe to your computer and use it in GitHub Desktop.
# Formula Calculator
formula = input("Enter the formula")
# 35 + 12
# 47
x = formula.find("+")
a = float(formula[:x])
b = float(formula[x+1:])
print(a + b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment