Sage/First Steps

InstallationEdit

Commandline InterfaceEdit

Notebook InterfaceEdit

IntroductionEdit

Sage is based on Python. With some exceptions, all commands are regular Python syntax.

Very simple calculationEdit

  • Numbers
 > sage: 1+1
 > 2
  • Symbolic expression
 > sage: sqrt(2)
 > sqrt(2)
  • Evaluate a symbolic expression
 > sage: sqrt(2).n(digits=100)
 > 1.414213562373095048801688724209698078569671875376948073176679737990732478462107038850387534327641573

ArraysEdit

 > sage: a = [1,2,3]
 > sage: sum(a)
 > 6
Last modified on 7 April 2014, at 20:31