Skip to content

Instantly share code, notes, and snippets.

@mkb2091
Created March 25, 2019 12:33
Show Gist options
  • Select an option

  • Save mkb2091/c5808c7c9b1c14b01b97bb6b13d162a9 to your computer and use it in GitHub Desktop.

Select an option

Save mkb2091/c5808c7c9b1c14b01b97bb6b13d162a9 to your computer and use it in GitHub Desktop.
import re, sys
while 1:print('Result:', sum(map(int, [re.sub('\s', '', i) for i in re.findall('(?:^[0-9]+)|(?:[\+\-]\s*[0-9]+)', input('Calc>>>'))])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment