LearnPy Hub
← Decorators problems
Hard

Plugin Registry

Write a decorator register(name) that stores functions in a dictionary COMMANDS. Register add, sub and mul. Read lines cmd a b until END and print each result, or unknown.

Input

Lines, then END.

Output

One line each.

Sample 1

Input
add 2 3
mul 4 5
END
Output
5
20

Sample 2

Input
div 1 2
END
Output
unknown
solution.py
Output appears here
Plugin Registry · Python practice problem · LearnPy Hub