11.07.2015 Views

Cryptography - Sage

Cryptography - Sage

Cryptography - Sage

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

at the command line:sage: x = 2sage: y = 2/1sage: z = ’2’sage: x2sage: y2sage: z’2’The operator == tests mathematical equality, which may involve an evaluation of one objectin the parent of the other to carry out the comparison.> x == yTrue> z == yFalseIn the first line above, the integer x is interpretted as a rational number and found to beequal to y (and vice versa).Booleans and boolean operatorsThe boolean truth values True and False have their own types in SAGE (in fact inPython), which take the special binary boolean operators and, or, and unary operatornot.sage: a = Truesage: type(a)sage: b = Falsesage: a and bFalsesage: a or bTruesage: not aFalseLists, tuples, sets, and dictionaries91

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!