Integer comparison: Difference between revisions
Content deleted Content added
Factor |
|||
Line 880:
(Note: in Python3 ''raw_input()'' will become ''input().'').
An alternative implementation could use a Python dictionary to house a small dispatch table to be indexed by the results of the
{{works with|Python|2.x}}
<lang Python>#!/usr/bin/env python
import sys
Line 899 ⟶ 900:
In this case the use of a dispatch table is silly. However, more generally in Python the use of dispatch dictionaries or tables is often preferable to long chains of '''''elif'''' clauses in a condition statement. Python's support of classes and functions (including currying, partial function support, and lambda expressions) as first class objects obviates the need for a "case" or "switch" statement.
=={{header|R}}==
<lang R>print("insert number a")
|