input_output/quickref.tex
author Puneeth Chaganti <punchagan@fossee.in>
Thu, 11 Nov 2010 03:00:19 +0530
changeset 460 5d032e253580
parent 329 5c8e88276e1f
permissions -rw-r--r--
Changes to getting started with Sage notebook.

Printing a variable:\\
{\ex \lstinline|    print x|}

Printing with out a new line:\\
{\ex \lstinline|    print x, |}

Using modifiers while printing:\\
{\ex \lstinline|    print "a is \%d b is \%f"\%(a, b)|}

Taking input from user:\\
{\ex \lstinline|    x = raw_input()|}

Display a prompt while taking input:\\
{\ex \lstinline|    x = raw_input("Type a number: ")|}