Last active
November 4, 2020 03:19
-
-
Save wellington-tinho/70f61b284defccd47fd377304c6c97cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calcPosFix(): | |
expression=list(input('insira a expressao: ')) | |
while(len(expression)>1): | |
if (len(expression)>3 and expression[2] == '*' and expression[3] == '*' ): | |
value = str(eval(expression[0])**(eval(expression[1]))) | |
for i in range(4): | |
del expression[0] | |
else: | |
value = str(eval(expression[0]+expression[2]+expression[1])) | |
for i in range(3): | |
del expression[0] | |
expression.insert(0,value) | |
print(expression) | |
calcPosFix() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment