Addition To Function Call Rule

expression a + b = __add__(a, b)

This rule says that in LW Python, the expression "a + b" is the same as the function call "__add__(a, b)"

In the simulator below, notice that line 1 states "5 + 2" but the "Expression" is set to "__add__(5, 2)." These expressions are equivalent.

Code Editor
LW Python State
Current Line1Current Tab0Time0
LW Python Simulator

Examples

expression 3 + 7 = __add__(3, 7)

expression 12 + 5 = __add__(12, 5)


Comments

Please log in to add comments