| 1 | initial version |
You need a colon:
if (v==0): f.factor()
I would actually write this as:
if f.is_irreducible():
f.factor()
Your assignment of v=f.is_irreducible() doesn't seem to be necessary unless you want to use v several times later. If so, you could do
v = f.is_irreducible()
if not v: # better than checking v == 0
f.factor()
| 2 | No.2 Revision |
You need a colon:
if (v==0): f.factor()
I would actually write this as:
if not f.is_irreducible():
f.factor()
Your assignment of v=f.is_irreducible() doesn't seem to be necessary unless you want to use v several times later. If so, you could do
v = f.is_irreducible()
if not v: # better than checking v == 0
f.factor()
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.