discount capture

Run Settings
LanguagePython
Language Version
Run Command
import re advertisement = "Get 30% discount on all items!" discount = 0.0 if (mo := re.search(r'(\d+)% discount', advertisement)): discount = float(mo.group(1)) / 100.0 print(discount)
Editor Settings
Theme
Key bindings
Full width
Lines