123456789101112131415161718192021222324 |
- import re
- s=[]
- o1=raw_input()
- s.append(o1)
- o2=raw_input()
- o3=list(o2)
- o4=s+o3
- if '+' in o4:
- a=o4.index('+')
- elif '-' in o4:
- a=o4.index('-')
- elif '*' in o4:
- a=o4.index('*')
- elif '/' in o4:
- a=o4.index('/')
- if o4[a] == '+':
- o=float(o4[a-2])+float(o4[a-1])
- elif o4[a] == '-':
- o=float(o4[a-2])-float(o4[a-1])
- elif o4[a] == '*':
- o=float(o4[a-2])*float(o4[a-1])
- elif o4[a] == '/':
- o=float(o4[a-2])/float(o4[a-1])
- print o
|