mirror of
https://github.com/python/cpython.git
synced 2025-10-16 19:57:59 +00:00
New == syntax
This commit is contained in:
parent
4d8e859e8f
commit
bdfcfccbe5
73 changed files with 419 additions and 391 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue