Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lines = []
- output = ''
- while True:
- try:
- lines.append(list(raw_input()))
- except EOFError:
- break
- lines = map(list, zip(*lines))
- numbers = {'+|+|+- -+|+|+':'0',
- '+|+|+':'1',
- '+ +|+- - -+|+ +':'2',
- '+ + +- - -+|+|+':'3',
- '+|+-+|+|+':'4',
- '+|+ +- - -+ +|+':'5',
- '+|+|+- - -+ +|+':'6',
- '+-+|+|+':'7',
- '+|+|+- - -+|+|+':'8',
- '+|+ +- - -+|+|+':'9',
- '':''}
- match = ''
- for line in lines:
- for i in range(10):
- line = ''.join(line).replace('||','|').replace(' ',' ').strip()
- if '-' not in match or '-' not in line:
- match += line
- if line == '' and match in numbers:
- output += numbers[match]
- match = ''
- print output
Add Comment
Please, Sign In to add comment