New == syntax

This commit is contained in:
Guido van Rossum 1992-01-01 19:35:13 +00:00
parent 4d8e859e8f
commit bdfcfccbe5
73 changed files with 419 additions and 391 deletions

View file

@ -39,9 +39,9 @@ def times(a, b):
return res
def power(a, n): # Raise polynomial a to the positive integral power n
if n = 0: return [1]
if n = 1: return a
if n/2*2 = n:
if n == 0: return [1]
if n == 1: return a
if n/2*2 == n:
b = power(a, n/2)
return times(b, b)
return times(power(a, n-1), a)