Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sample = input()
- legend = []
- while sample:
- if sample == '#':
- break
- for s in range(len(sample)):
- if sample[s] == '+':
- a = 'a'
- o = s
- elif sample[s] == '-':
- a = 'b'
- o = s
- elif sample[s] == '*':
- a = 'c'
- o = s
- elif sample[s] == '=':
- e = s
- if a == 'a':
- note = int(sample[:o]) + int(sample[o+1:e]) == int(sample[e+1:])
- elif a == 'b':
- note = int(sample[:o]) - int(sample[o+1:e]) == int(sample[e+1:])
- elif a == 'c':
- note = int(sample[:o]) * int(sample[o+1:e]) == int(sample[e+1:])
- if note:
- legend.append('Correct')
- else:
- legend.append('Wrong')
- sample = input()
- for l in legend:
- print(l)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement